-
-
Notifications
You must be signed in to change notification settings - Fork 249
test(e2e): capture build logs to make test logs clear #5437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Captures build/dev logs through the build/dev helpers instead of manual proxyConsole and adds proper cleanup of helper processes.
- Removed all manual
proxyConsoleimports and calls, switching tests to usersbuild.logsor destructuredlogsfrombuild/dev. - Introduced
catchBuildErrorwhere tests expect failures and assertrsbuild.buildError. - Added
await rsbuild.close()orawait close()after assertions to clean up processes.
Reviewed Changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| e2e/cases/plugin-less/plugin-hints/index.test.ts | Removed proxyConsole, switched to build({ catchBuildError: true }), used rsbuild.logs and rsbuild.close(). |
| e2e/cases/plugin-api/plugin-transform-error-handle/index.test.ts | Swapped manual logs for rsbuild.logs, removed restore(), and added rsbuild.close(). |
| e2e/cases/performance/bundle-analyzer/index.test.ts | Replaced proxyConsole with rsbuild.logs, added rsbuild.close() in dev test. |
| e2e/cases/output/clean-dist-path/index.test.ts | Dropped proxyConsole, updated second test to use rsbuild.logs and rsbuild.close(). |
| e2e/cases/node-polyfill-tip/without-protocol/index.test.ts | Changed to build({ catchBuildError: true }), used rsbuild.logs, asserted rsbuild.buildError, and closed. |
| e2e/cases/node-polyfill-tip/with-protocol/index.test.ts | Same as above for with‐protocol case. |
| e2e/cases/module/exports-presence/index.test.ts | Converted to build({ catchBuildError: true }), used rsbuild.logs, checked buildError, and closed. |
| e2e/cases/lazy-compilation/port-placeholder/index.test.ts | Removed proxyConsole, switched to rsbuild.logs and rsbuild.close(). |
| e2e/cases/lazy-compilation/dynamic-import/index.test.ts | Same refactor: drop proxyConsole, use rsbuild.logs, and close. |
| e2e/cases/lazy-compilation/basic/index.test.ts | Identical changes for lazy-compilation basic case. |
| e2e/cases/javascript-api/custom-logger/index.test.ts | Removed manual logs, used rsbuild.logs, and cleaned up with rsbuild.close(). |
| e2e/cases/css/resolve-ts-paths/index.test.ts | Dropped try/finally restore(), used rsbuild.close(). |
| e2e/cases/css/nested-npm-import/index.test.ts | Removed proxyConsole, replaced logs with rsbuild.logs, and closed. |
| e2e/cases/css/import-common-css/index.test.ts | Same refactor: rsbuild.logs and rsbuild.close(). |
| e2e/cases/css/enable-experiments-css/index.test.ts | Updated both tests to use rsbuild.logs and call rsbuild.close(). |
| e2e/cases/config/stats-options/index.test.ts | Swapped to rsbuild.logs in both tests and added rsbuild.close(). |
| e2e/cases/config/stats-module-trace/index.test.ts | Added catchBuildError, used rsbuild.logs, asserted buildError, and closed. |
| e2e/cases/config/rspack-config-validate/index.test.ts | Refactored both cases to use rsbuild.logs, removed restore(), and closed. |
| e2e/cases/config/inspect-config/debug.test.ts | First test destructures close, second uses rsbuild.close(), and both use rsbuild.logs. |
| e2e/cases/alias/legacy-alias/index.test.ts | Removed proxyConsole, switched to rsbuild.logs, and added rsbuild.close(). |

Summary
proxyConsoleby default in thedevandbuildtest helpers.Checklist