source: frontend/node_modules/eslint-plugin-jest/docs/rules/no-test-prefixes.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 884 bytes
Line 
1# Use `.only` and `.skip` over `f` and `x` (`no-test-prefixes`)
2
3Jest allows you to choose how you want to define focused and skipped tests, with
4multiple permutations for each:
5
6- **only & skip:** `it.only`, `test.only`, `describe.only`, `it.skip`,
7 `test.skip`, `describe.skip`.
8- **'f' & 'x':** `fit`, `fdescribe`, `xit`, `xtest`, `xdescribe`.
9
10This rule enforces usages from the **only & skip** list.
11
12## Rule details
13
14This rule triggers a warning if you use one of the keywords from the **'f' &
15'x'** list to focus/skip a test.
16
17```js
18/*eslint jest/no-test-prefixes: "error"*/
19
20it.only('foo'); // valid
21test.only('foo'); // valid
22describe.only('foo'); // valid
23it.skip('foo'); // valid
24test.skip('foo'); // valid
25describe.skip('foo'); // valid
26
27fit('foo'); // invalid
28fdescribe('foo'); // invalid
29xit('foo'); // invalid
30xtest('foo'); // invalid
31xdescribe('foo'); // invalid
32```
Note: See TracBrowser for help on using the repository browser.