chore(deps): replace supertest with @eggjs/supertest#5483
Conversation
Replace the external supertest dependency with the internal @eggjs/supertest package across the monorepo. This change uses the workspace's own supertest implementation instead of the external package. - Remove supertest and @types/supertest from pnpm catalog - Update package.json files in koa and egg-bin packages - Update all import statements from 'supertest' to '@eggjs/supertest' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughReplaced external Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Summary of Changes
Hello @fengmk2, 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 centralizes the testing utility by migrating from the external supertest package to an internal @eggjs/supertest workspace package. This change ensures consistency in testing practices across the monorepo and leverages a unified, internally managed version of the testing library. The update involves adjusting package dependencies and refactoring import paths in test files.
Highlights
- Dependency Replacement: The external
supertestand its corresponding@types/supertestdependencies have been replaced with the internal@eggjs/supertestpackage across the monorepo. - Package Configuration Updates: The
package.jsonfiles forpackages/koaandtools/egg-binhave been updated to reflect the new workspace dependency on@eggjs/supertestand remove the oldsupertestreferences. - Import Statement Refactoring: All relevant test files within
packages/koaandtools/egg-binhave been updated to change their import statements fromimport request from 'supertest'toimport { request } from '@eggjs/supertest'. - Lockfile Synchronization: The
pnpm-lock.yamlandpnpm-workspace.yamlfiles have been updated to remove the oldsupertestand@types/supertestentries from the catalog and package definitions, and to include the new workspace dependency.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the external supertest dependency with the internal @eggjs/supertest package across the monorepo to standardize on the workspace's own supertest implementation.
Key changes:
- Remove supertest and @types/supertest from the pnpm catalog
- Update package dependencies in koa and egg-bin packages
- Change import statements from default imports to named imports
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pnpm-workspace.yaml | Remove supertest and @types/supertest from catalog dependencies |
| packages/koa/package.json | Replace @types/supertest and supertest with @eggjs/supertest workspace dependency |
| tools/egg-bin/package.json | Replace @types/supertest and supertest with @eggjs/supertest workspace dependency |
| Multiple test files | Update import statements from default import to named import syntax |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
There was a problem hiding this comment.
Code Review
This pull request replaces the supertest dependency with the internal @eggjs/supertest package. The changes are mostly mechanical, updating package configurations and import statements. My main feedback is to use the default import for @eggjs/supertest instead of the named import. The default export is designed to be a fully compatible drop-in replacement for supertest, including the .agent() method, which the named request export lacks. This will ensure better compatibility and prevent potential issues in the future.
# Conflicts: # pnpm-lock.yaml # pnpm-workspace.yaml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #5483 +/- ##
==========================================
- Coverage 76.24% 75.31% -0.94%
==========================================
Files 104 95 -9
Lines 5696 5554 -142
Branches 1196 1178 -18
==========================================
- Hits 4343 4183 -160
- Misses 1183 1199 +16
- Partials 170 172 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

Replace the external supertest dependency with the internal @eggjs/supertest package across the monorepo. This change uses the workspace's own supertest implementation instead of the external package.
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Tests