-
-
Notifications
You must be signed in to change notification settings - Fork 746
test: use promise instead of done callback #11872
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 converts test files from using the done callback pattern to using Promises, following the Jest migration guide recommendation for rstest.rs. The changes modernize the test suite by replacing callback-based asynchronous tests with Promise-based async/await patterns.
Key changes:
- Convert
it("test name", (done) => { ... })toit("test name", () => new Promise((resolve, reject) => { ... })) - Replace
done()calls withresolve()anddone(err)calls withreject(err) - Convert some tests to use async/await syntax where appropriate
- Remove unnecessary
beforeEachandafterEachcallbacks that only calleddone()
Reviewed Changes
Copilot reviewed 292 out of 292 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Multiple test files | Convert from done callback pattern to Promise-based pattern |
| setup-env.ts | Update test wrapper to use Promise pattern |
| warmup-webpack.js | Convert warmup test to Promise pattern |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tests/rspack-test/configCases/split-chunks/runtime-chunk-async-node/c.js
Outdated
Show resolved
Hide resolved
📦 Binary Size-limit
🙈 Size remains the same at 47.67MB |
CodSpeed Performance ReportMerging #11872 will not alter performanceComparing Summary
|
Summary
Use
promiseinstead ofdonecallback in tests.https://rstest.rs/guide/migration/jest#done-callback
Related links
Checklist