You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
💼 This rule is enabled in the ✅ `recommended`[config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
6
+
7
+
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
AVA only allows specific [test modifier](https://github.com/avajs/ava/blob/main/docs/01-writing-tests.md) chains. Using modifiers in the wrong order, combining incompatible modifiers, or using modifiers that don't apply to a given test type will cause runtime errors.
14
+
15
+
## Examples
16
+
17
+
```js
18
+
importtestfrom'ava';
19
+
20
+
// Wrong order
21
+
test.only.serial(t=> {}); // ❌
22
+
test.serial.only(t=> {}); // ✅
23
+
24
+
test.failing.serial(t=> {}); // ❌
25
+
test.serial.failing(t=> {}); // ✅
26
+
27
+
// Invalid combinations
28
+
test.only.skip(t=> {}); // ❌
29
+
30
+
// Invalid modifiers on hooks
31
+
test.before.failing(t=> {}); // ❌
32
+
test.before.only(t=> {}); // ❌
33
+
test.before(t=> {}); // ✅
34
+
35
+
// Invalid todo chains
36
+
test.todo.failing('title'); // ❌
37
+
test.todo('title'); // ✅
38
+
39
+
// Invalid always usage
40
+
test.before.always(t=> {}); // ❌ `.always` only works with `after`/`afterEach`
0 commit comments