Skip to content

[JSON Reporter] value numPassedTests calculation mistake in json output #6027

@Emiyaaaaa

Description

@Emiyaaaaa

Describe the bug

I notice this code

const numPassedTests = numTotalTests - numFailedTests

https://github.com/vitest-dev/vitest/blob/main/packages/vitest/src/node/reporters/json.ts#L107

I think the skipped tests are not passed tests, this code should be

const numPassedTests = numTotalTests - numFailedTests - numSkippedTests

Reproduction

any tests with skip tests

System Info

any system

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)pr welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions