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 addresses the TODO comment by implementing proper log cleaning before development recompiles. The change moves log clearing to occur before compilation starts instead of after completion.
- Replaces
onDevCompileDonewithonBeforeDevCompileandonAfterDevCompilehooks - Moves
clearLogs()to execute before recompilation begins - Separates snapshot clearing and test execution to the after-compile hook
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/core/src/core/runTests.ts
Outdated
|
|
||
| rsbuildInstance.onDevCompileDone(async ({ isFirstCompile }) => { | ||
| // TODO: clean logs before dev recompile | ||
| rsbuildInstance.onBeforeDevCompile(async ({ isFirstCompile }) => { |
There was a problem hiding this comment.
The onBeforeDevCompile callback is declared as async but doesn't contain any await operations. Consider removing the async keyword to avoid unnecessary promise overhead.
| rsbuildInstance.onBeforeDevCompile(async ({ isFirstCompile }) => { | |
| rsbuildInstance.onBeforeDevCompile(({ isFirstCompile }) => { |
| } | ||
| }); | ||
|
|
||
| rsbuildInstance.onAfterDevCompile(async ({ isFirstCompile }) => { |
There was a problem hiding this comment.
[nitpick] The onAfterDevCompile callback is declared as async but the isFirstCompile parameter is not used in this callback. Consider removing the unused parameter or adding a comment explaining why it's included for consistency.
Summary
clean logs before dev recompile.
Related Links
Checklist