fix(vite-plugin-angular): treat the vitest run command as a single run instead of watch mode#2374
Conversation
…n instead of watch mode
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes a bug in the Vitest plugin where the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
PR Checklist
isTestWatchMode()only detects the--runflag. Thevitest runsubcommand form (common in CI scripts and nx) falls through toreturn true, so one-shot runs keep watch-mode caches and pay extra incremental recompiles when modules are invalidated mid-run (for example by a dep re-optimize).Closes #2372
Affected scope
Recommended merge strategy for maintainer [optional]
Commit preservation note [optional]
n/a
What is the new behavior?
isTestWatchMode()also treats an exactrunargument as a one-shot run. The check uses exact match (args.includes('run')), so file filters likesrc/run-helpers.spec.tsare not affected (covered by a test). Watch runs started by nx still resolve to watch mode through the existing OR withconfig.server.watchinconfigResolved.Test plan
nx format:checkpnpm build(nx build-package vite-plugin-angular, tsc, no errors)pnpm test(full workspace green;nx test vite-plugin-angular: 624 passed, 3 skipped)isTestWatchMode(['run'])andisTestWatchMode(['run', 'src/example.spec.ts'])fail on the old code and pass with the fixDoes this PR introduce a breaking change?
Other information
Speed-only fix; no change to compile output.