Repository navigation
test(vite-plugin-ngp): check that vitest reruns a spec after a library template edit - #167
Merged
Merged
Conversation
…y template edit Starts Vitest in its watching mode on an app whose spec imports a component from libs/ui, outside Vitest's root, edits the component's template, and expects the rerun to fail on the new text. Without the plugin adding the template to the watcher, no rerun comes. Closes #147 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#139 made the plugin add each component template outside Vite's root to the watcher, but only the dev server was tested. Under Vitest, that watcher is Vitest's, and it also watches only its root.
How the new
test/vitest-watch.test.mjsworks:app/with a spec that importslibs/ui/badge.ts, a component outside Vitest's root.vitest --watchand waits for1 passed.libs/ui/badge.htmland expects the rerun to fail withExpected: "before" Received: "after".Checked:
watcher.add(template)removed fromdist/index.js, it fails after the 30 s wait, because no rerun comes.Docs: Testing ("Watch mode follows edits"), the 4 December changelog fix line, and the Vitest row in
docs/design.md.Closes #147
🤖 Generated with Claude Code