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
Rely on recursive fs.watch(), rather than Chokidar. On Linux this is supported from Node.js 20 onwards. It won't work for network shares and Docker volume mounts which would require polling, we'll find out if that's a problem or not. (For now, the previous implementation is still available.)
Use @vercel/nft to perform static dependency analysis, supporting ESM and CJS imports for JavaScript & TypeScript source files. This is a huge improvement over the previous runtime tracking of CJS imports, which did not support ESM.
Rewrite the change handling logic to be easier to follow (though it's still pretty complicated).
Improve integration with `@ava/typescript`. The watcher can now detect a change to a TypeScript source file, then wait for the corresponding build output to change before re-running tests.
Copy file name to clipboardexpand all lines: docs/recipes/watch-mode.md
+4
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ AVA 5 uses [`chokidar`] as the file watcher. Note that even if you see warnings
29
29
30
30
The same applies with AVA 6 when using the `ava5+chokidar` watcher. However you'll need to install `chokidar` separately.
31
31
32
+
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.
33
+
32
34
## Ignoring changes
33
35
34
36
By default AVA watches for changes to all files, except for those with a `.snap.md` extension, `ava.config.*` and files in [certain directories](https://github.com/novemberborn/ignore-by-default/blob/master/index.js) as provided by the [`ignore-by-default`] package.
@@ -43,6 +45,8 @@ AVA tracks which source files your test files depend on. If you change such a de
43
45
44
46
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
47
48
+
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.
49
+
46
50
Files accessed using the `fs` module are not tracked.
0 commit comments