-
-
Notifications
You must be signed in to change notification settings - Fork 746
test: migrate config tests to rstest #11895
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 rspack canceled.
|
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
This PR migrates configuration tests from Jest to rstest, introducing rstest as an alternative testing framework while maintaining Jest for other tests. The migration involves updating test file references from jest to rstest, adding rstest configuration, and adjusting test helper code to support both frameworks.
Key Changes
- Added rstest configuration file and package dependency to enable rstest-based testing
- Updated all test files to use
rstestAPI instead ofjestAPI (spyOn, fn, etc.) - Modified test infrastructure to support both Jest and rstest through conditional globals
Reviewed Changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rspack-test/rstest.config.ts | New rstest configuration mirroring Jest setup |
| tests/rspack-test/package.json | Added rstest dependency and test script |
| tests/rspack-test/jest.config.js | Excluded Config.test.js from Jest execution |
| packages/rspack-test-tools/src/test/creator.ts | Updated to support both Jest and rstest globals |
| packages/rspack-test-tools/src/helper/setup-env.ts | Added rstest environment variable handling |
| Multiple test files | Replaced jest references with rstest |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...s/rspack-test/configCases/concatenate-modules/runtime-specific-external/should-concat/lib.js
Show resolved
Hide resolved
...pack-test/configCases/concatenate-modules/runtime-specific-external/should-concat/connect.js
Show resolved
Hide resolved
📦 Binary Size-limit
🙈 Size remains the same at 47.67MB |
CodSpeed Performance ReportMerging #11895 will not alter performanceComparing Summary
Footnotes |
* Revert "test: Revert 'migrate config tests to rstest (#11895)' (#11902)" This reverts commit 1ff04bd. * test: throw stepSignal error * test: run afterExecute after check * chore: bump rstest --------- Co-authored-by: LingyuCoder <[email protected]>
Summary
migrate config tests from jest to rstest.
jest:

rstest:

Related links
Checklist