0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00

test(router-plugin): cover the webpack and Rspack generator watch mode

The webpack branch of the route generator host had no coverage, and nothing
checked that closing the compiler's watcher stops the generator's own
chokidar watcher (route-tree hosts, round-3 mutation testing item G).

In `compiler.watch` mode, per bundler: a created empty route file is
scaffolded and added to the route tree; after `watching.close()`, a route
file created later is left alone. The negative check needs a fixed wait
(the generator's watcher closes asynchronously and nothing signals it);
the test waits for the compiles to settle before closing, and cleans up
only after the watcher closed. Passed on base in every run (5 runs).

Mutants verified killed (through Nx): rp:1903 rp:1905 rp:1906 rp:1912
rp:1913 rp:1914 rp:1918 rp:1920 rp:1923 rp:1925 rp:1926; rp:1919 killed in
1 of 2 runs (webpack sometimes reports the created file through its own
watcher too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-17 07:23:26 +02:00
commit d9dad4804b
No known key found for this signature in database