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 undertakes a comprehensive migration of the project's testing framework from Jest to Rstest. The primary goal is to modernize the testing setup, leveraging Rstest's capabilities for improved performance and maintainability. The changes span across configuration files, package scripts, test utility functions, and snapshot formats, ensuring a smooth transition while preserving existing test coverage and behavior. 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
Activity
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 migrates the project's testing framework from Jest to Rstest. The changes include removing Jest's configuration and dependencies, adding the Rstest configuration, and updating test-related scripts and setup files. A compatibility layer has been added to support Jest's done() callback syntax in asynchronous tests, which is a good approach for a smooth migration.
However, I've found a critical issue in package.json where the test script is defined recursively, which will cause an infinite loop.
Additionally, the large test file test/logging.test.js has been removed entirely. Migrating to a new test runner should not result in a reduction of test coverage. This file should be migrated to Rstest instead of being removed.
There was a problem hiding this comment.
Pull request overview
This PR migrates the test setup from Jest to @rstest/core, updating test bootstrapping, snapshots, and a few test expectations to align with the new runner.
Changes:
- Replace Jest configuration with
rstest.config.mjsand update global test setup (setupTest.js). - Update/replace snapshot files to the new snapshot format and namespacing.
- Adjust a few tests for stability (e.g., less strict option object comparisons; dynamic asset filename selection).
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/ready.test.js | Adjusts expectation to use callback function name dynamically. |
| test/utils/snapshots/setupWriteToDisk.test.js.snap | Updates snapshots to new runner’s snapshot format/keys. |
| test/utils/snapshots/setupWriteToDisk.test.js | Removes legacy snapshot artifact file. |
| test/utils/snapshots/setupHooks.test.js.snap | Updates snapshots to new runner’s snapshot format/keys. |
| test/utils/snapshots/setupHooks.test.js | Removes legacy snapshot artifact file. |
| test/middleware.test.js | Updates imports, loosens a few assertions, and makes immutable-asset tests resilient by deriving the emitted SVG name from stats. |
| test/logging.test.js | Removes the logging integration test file. |
| test/snapshots/logging.test.js.snap | Adds new snapshot file for logging tests (but corresponding test file is missing). |
| test/snapshots/logging.test.js | Removes legacy snapshot artifact file. |
| setupTest.js | Replaces Jest timeout setup with rstest config and wraps done-style tests for compatibility. |
| scripts/globalSetup.mjs | Converts global setup to ESM and exports a setup() hook. |
| rstest.config.mjs | Adds rstest configuration (environment, include/exclude, setup/global setup files). |
| pnpm-lock.yaml | Removes Jest deps and adds rstest (and coverage plugin) lock entries. |
| package.json | Updates devDependencies for rstest and modifies test scripts (currently broken). |
| jest.config.js | Removes Jest configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f47d18d9a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
https://github.com/web-infra-dev/rstest