test: replace webpack with rspack in test files - #93
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request standardizes the bundler used within the project's end-to-end test files by migrating from Webpack to Rspack. This change ensures that the test environment accurately reflects the project's chosen build tool, improving consistency and reducing potential discrepancies between development and testing setups. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request consistently replaces the usage of webpack with rspack across numerous test files. The changes are straightforward, mainly involving search-and-replace operations on function calls and plugin instantiations. The refactoring is well-executed, ensuring that all tests now use rspack for bundling, which aligns with the project's tooling strategy. I've reviewed all the changes and found no issues; the migration appears to be correct and complete within the scope of the test files.
There was a problem hiding this comment.
Pull request overview
This PR updates the test suite to use the rspack API naming consistently instead of importing @rspack/core into a webpack variable, aligning tests with the project’s Rspack-based tooling.
Changes:
- Replaced
const webpack = require('@rspack/core')withconst { rspack } = require('@rspack/core')across e2e tests and helpers. - Updated compiler creation from
webpack(config)torspack(config)throughout the affected tests. - Updated plugin references in tests (e.g., HMR/Entry plugins) to use
rspack.*.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/helpers/test-server.js | Uses rspack(config) when creating the compiler for helper-based server setup. |
| tests/e2e/web-socket-server.test.js | Switches compiler creation to rspack(config). |
| tests/e2e/web-socket-server-url.test.js | Switches all compiler creation sites to rspack(config). |
| tests/e2e/web-socket-communication.test.js | Switches compiler creation to rspack(config) in all cases. |
| tests/e2e/watch-files.test.js | Switches compiler creation to rspack(config) across all suites. |
| tests/e2e/target.test.js | Switches compiler creation to rspack(...) including multi-compiler cases. |
| tests/e2e/stats.test.js | Uses rspack for compiler creation and version-gated test case logic. |
| tests/e2e/static-public-path.test.js | Switches compiler creation to rspack(config) across suites. |
| tests/e2e/static-directory.test.js | Switches compiler creation to rspack(config) across suites. |
| tests/e2e/setup-middlewares.test.js | Switches compiler creation to rspack(config). |
| tests/e2e/setup-exit-signals.test.js | Switches compiler creation to rspack(config). |
| tests/e2e/server.test.js | Switches compiler creation to rspack(config) across server option suites. |
| tests/e2e/server-and-client-transport.test.js | Switches compiler creation to rspack(...) across all transport cases. |
| tests/e2e/range-header.test.js | Switches compiler creation to rspack(config). |
| tests/e2e/progress.test.js | Switches compiler creation to rspack(reloadConfig). |
| tests/e2e/port.test.js | Switches compiler creation to rspack(config). |
| tests/e2e/overlay.test.js | Switches compiler creation to rspack(config) throughout overlay scenarios. |
| tests/e2e/on-listening.test.js | Switches compiler creation to rspack(config). |
| tests/e2e/multi-compiler.test.js | Switches compiler creation to rspack(...) across multi-compiler scenarios. |
| tests/e2e/module-federation.test.js | Switches compiler creation to rspack(...) across module federation scenarios. |
| tests/e2e/mime-types.test.js | Switches compiler creation to rspack(config) across suites. |
| tests/e2e/logging.test.js | Switches compiler creation to rspack(...) for logging test matrix. |
| tests/e2e/lazy-compilation.test.js | Switches compiler creation to rspack(...) in skipped lazy-compilation tests. |
| tests/e2e/ipc.test.js | Switches compiler creation to rspack(config) across IPC scenarios. |
| tests/e2e/hot-and-live-reload.test.js | Switches compiler creation to rspack(...) and updates HMR plugin usage accordingly. |
| tests/e2e/host.test.js | Switches compiler creation to rspack(config) across host scenarios. |
| tests/e2e/history-api-fallback.test.js | Switches compiler creation to rspack(config) across suites. |
| tests/e2e/headers.test.js | Switches compiler creation to rspack(config) across suites. |
| tests/e2e/entry.test.js | Switches compiler creation to rspack(...) and updates EntryPlugin usage accordingly. |
| tests/e2e/compress.test.js | Switches compiler creation to rspack(config) across suites. |
| tests/e2e/client.test.js | Switches compiler creation to rspack(...) across client option suites. |
| tests/e2e/client-reconnect.test.js | Switches compiler creation to rspack(config) across reconnect scenarios. |
| tests/e2e/built-in-routes.test.js | Switches compiler creation to rspack(config) for routes tests. |
| tests/e2e/app.test.js | Switches compiler creation to rspack(config) in app integration tests. |
| tests/e2e/api.test.js | Switches compiler creation to rspack(...) across API tests and manual configuration scenarios. |
| tests/e2e/allowed-hosts.test.js | Switches compiler creation to rspack(config) across allowed-hosts matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update test files to use rspack instead of webpack for consistency with the project's tooling. This change affects multiple test files across different test suites, ensuring all tests use the same bundler implementation.