vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
12.42k stars 1.11k forks source link

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

Closed Emiyaaaaa closed 3 days ago

Emiyaaaaa commented 1 month ago

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

Emiyaaaaa commented 1 month ago

If possible, I want to submit a PR to resolve this.