|
Ran
|
Files
50
|
Run time
5s
|
Badge
README BADGES
|
push
github
fix: watch mode using chokidar v4 (#5379) * fix: watch mode using chokidar v4 (#5355) Glob paths are no longer supported by chokidar starting at v4. This update works around this by resolving `watchFiles` and `watchIgnore` to valid paths and creating a list of matchers to determine if the files should be allowed or ignored through the chokidar `ignored` match function. This commit reverts changes from 8af0f1a90 so that the watched file changes are not fixed to the current directory. Additional note: when a `watchFile` path is removed while chokidar is watching it, recreating the `watchFile` path does not trigger events from chokidar to rerun the tests. * refactor: fix watch mode using chokidar v4 (#5355) This update fixes #5355 and refactors the previous watch mode fix attempt. Instead of only filtering the paths in the chokidar `ignored` match function, the chokidar `all` event handler now has a guard to ensure that only file paths that match the allowed patterns from `watchFiles` would trigger test reruns. Doing this solves the issue where creating/deleting directories trigger test reruns despite the watched path being a file (e.g., `**/*.xyz`) as the allowed patterns would not match with just the directory paths. * docs: fix jsdoc description for `normalizeGlob()` * test: add tests for watch mode - Test for watched files from outside the current working directory - Test reruns with a thousand watched files * test: fix test for multiple watched files * test: remove test for multiple watched files The test is dependent on how fast the machine could create 1000 watched files, otherwise the test could fail due to a timeout error. Reducing the number of watched files would make the test pass, but doing so would make it more or less similar to already existing tests. At that point, the test does not really test the limits of possibly huge projects with thousands of watched files, so it has been removed instea... (continued)
333 of 1539 branches covered (21.64%)
1570 of 3634 relevant lines covered (43.2%)
2.5 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|