Conversation
Summary of ChangesHello @9aoy, 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 undertakes a significant refactoring of the project's testing infrastructure by migrating from the Jest framework to rstest. The change aims to streamline the testing process and potentially leverage new features or performance benefits offered by rstest. It involves updating core configurations, modifying test files to use the new API, and adjusting project dependencies accordingly. 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.
Pull request overview
This pull request migrates the test suite from Jest to rstest, a testing framework. The migration involves updating test runner configuration, replacing Jest-specific APIs with rstest equivalents, modernizing async test patterns, and updating snapshot file headers.
Changes:
- Replaced Jest with rstest test runner and updated all test APIs (jest.fn → rstest.fn, jest.spyOn → rstest.spyOn, etc.)
- Created new rstest.config.ts configuration and removed Jest-specific configuration files
- Updated test helpers including setup-test.js with rstest-specific workarounds and removed Jest-only files like snapshot-resolver.js and sequencer.js
Reviewed changes
Copilot reviewed 53 out of 56 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rstest.config.ts | New rstest configuration with snapshot resolution and test setup |
| package.json | Updated dependencies: removed Jest packages, added @rstest/core |
| jest.config.js | Removed Jest configuration |
| tests/helpers/setup-test.js | Added rstest-specific module resolution workarounds and process.binding polyfill |
| tests/helpers/snapshot-resolver.js | Removed (functionality moved to rstest.config.ts) |
| tests/helpers/sequencer.js | Removed Jest test sequencer |
| tests/helpers/global-setup-test.js | Removed port validation logic |
| tests/helpers/normalize.js | Removed TAPABLE normalization (no longer needed) |
| tests/helpers/test-server.js | Updated comment reference from "jest" to "the test runner" |
| tests/normalizeOptions.test.ts | Removed jest-serializer-path dependency |
| tests/e2e/*.test.js | Updated test APIs from Jest to rstest (fn, spyOn, etc.) and modernized async patterns |
| tests/e2e/snapshots/*.snap.webpack5 | Updated snapshot headers from "Jest Snapshot v1" to "Rstest Snapshot v1" and test name format |
| tests/fixtures/worker-config-dev-server-false/public/worker-bundle.js | Modified formatting |
| scripts/patch-node-env.cjs | Removed Jest-specific environment patch |
| tests/rstest-env.d.ts | Added TypeScript reference for rstest globals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request migrates the test suite from Jest to rstest. The changes involve updating configurations, dependencies, and test API calls. Overall, the migration looks good, but I've found a few critical issues where an incorrect global rs is used instead of rstest. These will cause tests to fail and need to be addressed.
migrate tests to rstest.