Summary
require-local-test-context-for-concurrent-snapshots currently misses concurrent tests declared via Vitest's options object:
test('snapshot test', { concurrent: true }, () => {
expect(1).toMatchSnapshot()
})
This form is currently not reported.
Since this test is concurrent, snapshot assertions should use the local Test Context expect instead of the global expect.
Reproduction
Add the following case to the invalid section of tests/require-local-test-context-for-concurrent-snapshots.test.ts.
{
code: 'it("snapshot test", { concurrent: true }, () => { expect(1).toMatchSnapshot() })',
errors: [{ messageId: 'requireLocalTestContext' }],
},
Then run:
pnpm test tests/require-local-test-context-for-concurrent-snapshots.test.ts
Currently, this case fails because the rule only checks the .concurrent chain form and does not recognize { concurrent: true }.
Summary
require-local-test-context-for-concurrent-snapshotscurrently misses concurrent tests declared via Vitest's options object:This form is currently not reported.
Since this test is concurrent, snapshot assertions should use the local Test Context expect instead of the global expect.
Reproduction
Add the following case to the invalid section of
tests/require-local-test-context-for-concurrent-snapshots.test.ts.Then run:
Currently, this case fails because the rule only checks the
.concurrentchain form and does not recognize{ concurrent: true }.