Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 727 Bytes

require-local-test-context-for-concurrent-snapshots.md

File metadata and controls

33 lines (24 loc) · 727 Bytes

Require local Test Context for concurrent snapshot tests (vitest/require-local-test-context-for-concurrent-snapshots)

💼 This rule is enabled in the ✅ recommended config.

Rule details

Examples of incorrect code for this rule:

test.concurrent('myLogic', () => {
    expect(true).toMatchSnapshot();
})

describe.concurrent('something', () => {
    test('myLogic', () => {
        expect(true).toMatchInlineSnapshot();
    })
})

Examples of correct code for this rule:

test.concurrent('myLogic', ({ expect }) => {
    expect(true).toMatchSnapshot();
})

test.concurrent('myLogic', (context) => {
    context.expect(true).toMatchSnapshot();
}