Skip to content

Commit

Permalink
feat(vitest/require-local-test-context-for-concurrent-snapshots): add…
Browse files Browse the repository at this point in the history
… rule
  • Loading branch information
Haberkamp committed Dec 9, 2023
1 parent 864205b commit e2a82cf
Show file tree
Hide file tree
Showing 5 changed files with 10,875 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/rules/require-local-test-context-for-concurrent-snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Require local Test Context for concurrent snapshot tests (`vitest/require-local-test-context-for-concurrent-snapshots`)

💼 This rule is enabled in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

## Rule details

Examples of **incorrect** code for this rule:

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

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

Examples of **correct** code for this rule:

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

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

0 comments on commit e2a82cf

Please sign in to comment.