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
+4-56Lines changed: 4 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -6,58 +6,13 @@ AVA comes with an intelligent watch mode. It watches for files to change and run
6
6
7
7
## Running tests with watch mode enabled
8
8
9
-
You can enable watch mode using the `--watch` or `-w` flags. If you have installed AVA globally:
9
+
You can enable watch mode using the `--watch` or `-w` flags:
10
10
11
11
```console
12
-
$ ava --watch
12
+
$ npx ava --watch
13
13
```
14
14
15
-
If you've configured it in your `package.json` like this:
16
-
17
-
```json
18
-
{
19
-
"scripts": {
20
-
"test": "ava"
21
-
}
22
-
}
23
-
```
24
-
25
-
You can run:
26
-
27
-
```console
28
-
$ npm test -- --watch
29
-
```
30
-
31
-
You could also set up a special script:
32
-
33
-
```json
34
-
{
35
-
"scripts": {
36
-
"test": "ava",
37
-
"watch:test": "ava --watch"
38
-
}
39
-
}
40
-
```
41
-
42
-
And then use:
43
-
44
-
```console
45
-
$ npm run watch:test
46
-
```
47
-
48
-
Finally you could configure AVA to *always* run in watch mode by setting the `watch` key in the [`ava` section of your `package.json`, or `ava.config.*` file][config].
49
-
50
-
**`package.json`:**
51
-
52
-
```json
53
-
{
54
-
"ava": {
55
-
"watch": true
56
-
}
57
-
}
58
-
```
59
-
60
-
Please note that the TAP reporter is unavailable when using watch mode.
15
+
Please note that integrated debugging and the TAP reporter are unavailable when using watch mode.
61
16
62
17
## Requirements
63
18
@@ -98,14 +53,7 @@ You can update failing snapshots by typing <kbd>u</kbd> on the console, followed
98
53
Sometimes watch mode does something surprising like rerunning all tests when you thought only a single test would be run. To see its reasoning you can enable a debug mode. This will work best with the verbose reporter:
0 commit comments