supertest-with-proxy is a specialized wrapper around the popular `supertest` library, designed to facilitate testing HTTP servers that require proxy configurations. It extends `supertest`'s capabilities by enabling the specification of an HTTP proxy for test requests, a common requirement in enterprise or complex network environments. The current stable version is 5.0.2. This package appears to be abandoned, with its last publish occurring over six years ago, meaning there are no active releases or maintenance, and its compatibility with modern Node.js or `supertest` versions is uncertain. Its key differentiator was providing direct proxy integration, which standard `supertest` does not offer out-of-the-box, simplifying testing for proxy-aware applications with a familiar, chainable API.
npm install supertest-with-proxyVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use `supertest-with-proxy` to test an Express.js application's `/user` endpoint, routing the request through a specified proxy server and asserting the response.
Consider migrating to actively maintained alternatives or implementing proxy logic directly within standard `supertest` setups (e.g., using global-agent or a custom `superagent` wrapper).
Thoroughly test on your target Node.js version. Be prepared for potential compatibility issues and consider alternative proxy solutions for `supertest`.
Verify compatibility with the `supertest` version you intend to use. If issues arise, you might be forced to downgrade `supertest` or explore alternative proxy integration methods for testing.
Change `import request from 'supertest-with-proxy';` to `const request = require('supertest-with-proxy');`.Ensure your Node.js version is compatible (though old versions are specified, newer ones might break it). Reinstall the package (`npm install supertest-with-proxy`) to rule out corrupted node_modules. Check for conflicting dependencies or global Node.js module issues.