Skip to content

Commit e07179b

Browse files
authored
Remove ability to select AVA 5 watcher
When I first retained the AVA 5 logic, it was under the assumption AVA 6 would be released in the summer with another breaking release later in the year. It's now autumn, Node.js 16 is end of life, and for now it's just not worth having this logic around. Depending on how well the watcher works I'm not opposed to having it as an experimental "select your watch mode" feature though.
1 parent cf0fa4c commit e07179b

File tree

11 files changed

+42
-725
lines changed

11 files changed

+42
-725
lines changed

docs/recipes/watch-mode.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/docs
44

55
AVA comes with an intelligent watch mode. It watches for files to change and runs just those tests that are affected.
66

7-
AVA 6 is introducing a new watch mode that relies on recurse file watching in Node.js. To use the old watch mode, set the implementation to `ava5+chokidar` and install [`chokidar`] alongside AVA:
8-
9-
`ava.config.mjs`:
10-
```js
11-
export default {
12-
watchMode: {
13-
implementation: 'ava5+chokidar',
14-
},
15-
}
16-
```
17-
187
## Running tests with watch mode enabled
198

209
You can enable watch mode using the `--watch` or `-w` flags:
@@ -29,8 +18,6 @@ Please note that integrated debugging and the TAP reporter are unavailable when
2918

3019
AVA 5 uses [`chokidar`] as the file watcher. Note that even if you see warnings about optional dependencies failing during install, it will still work fine. Please refer to the *[Install Troubleshooting]* section of `chokidar` documentation for how to resolve the installation problems with chokidar.
3120

32-
The same applies with AVA 6 when using the `ava5+chokidar` watcher. However you'll need to install `chokidar` separately.
33-
3421
Otherwise, AVA 6 uses `fs.watch()`. Support for `recursive` mode is required. Note that this has only become available on Linux since Node.js 20. [Other caveats apply](https://nodejs.org/api/fs.html#caveats), for example this won't work well on network filesystems and Docker host mounts.
3522

3623
## Ignoring changes
@@ -55,7 +42,7 @@ If your tests write to disk they may trigger the watcher to rerun your tests. Co
5542

5643
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.
5744

58-
AVA 5 (and the `ava5+chokidar` watcher in AVA 6) spies on `require()` calls to track dependencies. Custom extensions and transpilers are supported, provided you [added them in your `package.json` or `ava.config.*` file][config], and not from inside your test file.
45+
AVA 5 spies on `require()` calls to track dependencies. Custom extensions and transpilers are supported, provided you [added them in your `package.json` or `ava.config.*` file][config], and not from inside your test file.
5946

6047
With AVA 6, dependency tracking works for `require()` and `import` syntax, as supported by [@vercel/nft](https://github.com/vercel/nft). `import()` is supported but dynamic paths such as `import(myVariable)` are not.
6148

0 commit comments

Comments
 (0)