Skip to content

Commit 5993ce1

Browse files
fix: json reporter detects skip mode correctly (#930)
1 parent 6262c29 commit 5993ce1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/vitest/src/node/reporters/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class JsonReporter implements Reporter {
5656
const testResults: Array<TestResult> = tests.map(t => ({
5757
displayName: t.name,
5858
failureMessage: t.result?.error?.message,
59-
skipped: t.result?.state === 'skip',
59+
skipped: t.mode === 'skip',
6060
status: t.result?.state,
6161
testFilePath: t.file?.filepath,
6262
}))

test/reporters/tests/__snapshots__/reporters.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ exports[`json reporter 1`] = `
5959
},
6060
{
6161
\\"displayName\\": \\"async with timeout\\",
62-
\\"skipped\\": false,
62+
\\"skipped\\": true,
6363
\\"testFilePath\\": \\"/vitest/test/core/test/basic.test.ts\\"
6464
},
6565
{

0 commit comments

Comments
 (0)