Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Oct 14, 2025

Summary

Use promise instead of done callback in tests.

https://rstest.rs/guide/migration/jest#done-callback

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 14, 2025 13:02
@9aoy 9aoy requested a review from LingyuCoder as a code owner October 14, 2025 13:02
@netlify
Copy link

netlify bot commented Oct 14, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 0c15d0e
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68ef0e452dd5890008d0dd9f

Copy link
Contributor

Copilot AI left a 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) => { ... }) to it("test name", () => new Promise((resolve, reject) => { ... }))
  • Replace done() calls with resolve() and done(err) calls with reject(err)
  • Convert some tests to use async/await syntax where appropriate
  • Remove unnecessary beforeEach and afterEach callbacks that only called done()

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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

📦 Binary Size-limit

Comparing 0c15d0e to chore: avoid using BROWSER env (#11855) by Qingyu Wang

🙈 Size remains the same at 47.67MB

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 14, 2025

CodSpeed Performance Report

Merging #11872 will not alter performance

Comparing done-callback (0c15d0e) with main (e259bc7)

Summary

✅ 17 untouched

@9aoy 9aoy merged commit 5c01f2e into main Oct 15, 2025
44 checks passed
@9aoy 9aoy deleted the done-callback branch October 15, 2025 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants