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

test(compiler-test-utils): the self-test's generator writes atomically

The dev-server harness self-test "reports created, renamed and deleted
files to the plugins, and the files they write meanwhile" failed 3 times
in the V4 variant phase (load ~30): once with an extra `update
generated.ts` after `create generated.ts`, twice with "the file watcher
did not report generated.ts". Its generator plugin wrote with a plain
`writeFile`: a truncation and a write. Under load the watcher reports
the two steps of a new file as an `add` and a `change` (the extra
update), and for an existing file the harness can read the empty file
at the first event while the content lands in the same millisecond, so
chokidar's mtime check never reports the second step (the timeout). A
generator writes atomically (the router generator's `safeFileWrite`);
the self-test now does too, through the harness's `saveAppFile`.

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