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
Copy file name to clipboardExpand all lines: docs/recipes/watch-mode.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,35 @@ export default {
34
34
35
35
If your tests write to disk they may trigger the watcher to rerun your tests. Configuring additional ignore patterns helps avoid this.
36
36
37
+
### Filter tests while watching
38
+
You may also filter tests while watching by using the cli. For example, after running
39
+
```console
40
+
$ npx ava --watch
41
+
```
42
+
You will see a prompt like this :
43
+
```console
44
+
Type `p` and press enter to filter by a filename regex pattern
45
+
[Current filename filter is $pattern]
46
+
Type `t` and press enter to filter by a test name regex pattern
47
+
[Current test filter is $pattern]
48
+
49
+
[Type `a` and press enter to run *all* tests]
50
+
(Type `r` and press enter to rerun tests ||
51
+
Type \`r\` and press enter to rerun tests that match your filters)
52
+
Type `u` and press enter to update snapshots
53
+
54
+
command >
55
+
```
56
+
So, to run only tests numbered like
57
+
- foo23434
58
+
- foo4343
59
+
- foo93823
60
+
61
+
You can type `t` and press enter, then type `foo\d+` and press enter.
62
+
This will then run all tests that match that pattern.
63
+
Afterwards you can use the `r` command to run the matched tests again,
64
+
or `a` command to run **all** tests.
65
+
37
66
## Dependency tracking
38
67
39
68
AVA tracks which source files your test files depend on. If you change such a dependency only the test file that depends on it will be rerun. AVA will rerun all tests if it cannot determine which test file depends on the changed source file.
0 commit comments