-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vitest/require-local-test-context-for-concurrent-snapshots): add…
… rule
- Loading branch information
Showing
5 changed files
with
10,875 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
docs/rules/require-local-test-context-for-concurrent-snapshots.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
``` |
Oops, something went wrong.