{"id":17375,"library":"supertest-with-proxy","title":"Supertest with Proxy Support","description":"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.","status":"abandoned","version":"5.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/soniajasuja/supertest","tags":["javascript","superagent","supertest proxy","request","tdd","bdd","http","test","testing"],"install":[{"cmd":"npm install supertest-with-proxy","lang":"bash","label":"npm"},{"cmd":"yarn add supertest-with-proxy","lang":"bash","label":"yarn"},{"cmd":"pnpm add supertest-with-proxy","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a wrapper/extension for `supertest`, providing its core HTTP testing functionality.","package":"supertest","optional":false},{"reason":"`supertest` itself is built upon `superagent` for making HTTP requests, making this an indirect but critical dependency.","package":"superagent","optional":false}],"imports":[{"note":"This library is primarily CommonJS (CJS). ESM import syntax will lead to errors.","wrong":"import request from 'supertest-with-proxy';","symbol":"request","correct":"const request = require('supertest-with-proxy');"},{"note":"The library exports a single function as its default, not named exports. Destructuring will result in an undefined 'request'.","wrong":"const { request } = require('supertest-with-proxy');","symbol":"request","correct":"const request = require('supertest-with-proxy');"},{"note":"Incorrect usage for both CJS-only package and trying to import a non-existent named export.","wrong":"import { request } from 'supertest-with-proxy';","symbol":"request","correct":"const request = require('supertest-with-proxy');"}],"quickstart":{"code":"const request = require('supertest-with-proxy');\nconst express = require('express');\n\nconst app = express();\n\napp.get('/user', function(req, res) {\n  res.status(200).json({ name: 'john' });\n});\n\nrequest(app)\n  .get('/user')\n  .proxy('http://example.com')\n  .expect('Content-Type', /json/)\n  .expect('Content-Length', '15')\n  .expect(200)\n  .end(function(err, res) {\n    if (err) throw err;\n    console.log('Test passed for user endpoint with proxy.');\n  });","lang":"javascript","description":"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."},"warnings":[{"fix":"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).","message":"The package has not been updated in over six years and is considered abandoned. This means no new features, bug fixes, or security patches will be released, potentially leading to critical vulnerabilities or incompatibility with modern environments.","severity":"breaking","affected_versions":">=5.0.2"},{"fix":"Thoroughly test on your target Node.js version. Be prepared for potential compatibility issues and consider alternative proxy solutions for `supertest`.","message":"The `engines.node` field specifies `>=6.0.0`, which is an extremely old Node.js version. Running this package on recent Node.js versions (e.g., Node.js 16, 18, 20+) may lead to unexpected behavior or runtime errors due to breaking changes in Node.js itself.","severity":"gotcha","affected_versions":">=5.0.2"},{"fix":"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.","message":"The package's README points to a specific fork of `supertest` (`tauheedkhan/supertest` or `soniajasuja/supertest`) rather than the official, actively maintained `supertest` package. This suggests it might be tightly coupled to an older or specific `supertest` version, leading to potential API inconsistencies or a lack of support for features introduced in newer `supertest` releases.","severity":"gotcha","affected_versions":">=5.0.2"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Change `import request from 'supertest-with-proxy';` to `const request = require('supertest-with-proxy');`.","cause":"Attempting to import a CommonJS-only package using ES Module `import` syntax in an ESM project.","error":"TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension \".js\" for /path/to/node_modules/supertest-with-proxy/index.js"},{"fix":"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.","cause":"This error can occur if `require('supertest-with-proxy')` returns `undefined` or an unexpected value, often due to Node.js version incompatibility or an issue during module loading.","error":"supertest-with-proxy is not a function"}],"ecosystem":"npm","meta_description":null}