chore: use isFirstCompile instead of isFirstRun#506
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the first run test logic by removing the isFirstRun tracking mechanism and instead using the existing isFirstCompile flag to determine when to run all tests versus on-demand tests.
- Removes
isFirstRuntracking logic and related variables - Uses
isFirstCompileflag to conditionally set test mode to 'all' or 'on-demand' - Updates test expectations to reflect the new "Run all tests" message
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/core/runTests.ts | Removes isFirstRun parameter usage and simplifies conditional logic for test mode selection |
| packages/core/src/core/rsbuild.ts | Removes isFirstRun tracking variables and related logic from the rsbuild server |
| e2e/watch/shortcuts.test.ts | Updates test expectations from "Fully run test files for first run" to "Run all tests" |
| e2e/watch/index.test.ts | Updates test expectations from "Fully run test files for first run" to "Run all tests" |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (mode === 'on-demand') { | ||
| if (isFirstRun) { | ||
| logger.debug(color.yellow('Fully run test files for first run.\n')); | ||
| if (affectedEntries.length === 0) { |
There was a problem hiding this comment.
The removal of the isFirstRun condition creates a logic error. Previously, the first run would skip the on-demand filtering and run all tests. Now, even on the first run with mode 'on-demand', if there are no affected entries, no tests will run at all.
Summary
simplify
isFirstRuncheck when run tests.Related Links
Checklist