test: replace supertest with custom http request helper#99
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 aims to streamline the project's testing infrastructure by eliminating the external 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 PR removes the supertest dependency from the test suite and replaces its usage with a lightweight in-repo HTTP request helper to reduce dependency and transitive dependency footprint.
Changes:
- Added a custom Node
http/httpsrequest helper for tests (tests/helpers/http-request.js). - Replaced
supertestusage in affected e2e tests with the new helper. - Removed
supertestfrompackage.jsonand updatedpnpm-lock.yamlaccordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/normalizeOptions.test.ts | Minor formatting adjustment (no behavior change). |
| tests/helpers/http-request.js | Introduces a custom HTTP(S) request helper to replace supertest in tests. |
| tests/e2e/server.test.js | Switches requestCert-related test request from supertest to the new helper. |
| tests/e2e/server-and-client-transport.test.js | Minor formatting adjustment (no behavior change). |
| tests/e2e/range-header.test.js | Replaces supertest-based range/HEAD requests with the new helper. |
| tests/e2e/headers.test.js | Replaces supertest usage with the new helper for HEAD verification. |
| tests/e2e/client.test.js | Minor formatting adjustment (no behavior change). |
| package.json | Removes the supertest dev dependency. |
| pnpm-lock.yaml | Removes supertest and its transitive dependency entries from the lockfile. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 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 successfully removes the supertest dependency and replaces its usage with a custom HTTP request helper, which is a great simplification. The new helper in tests/helpers/http-request.js is well-structured. I've suggested a refactoring for the requestByApp function to improve its readability and error handling robustness by using async/await and a try...finally block. Overall, this is a solid improvement.
Removes the
supertesttesting dependency and all its related transitive dependencies from the project, replacing its usage in tests with a custom HTTP request helper.