JSPM

supertest-with-proxy

5.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10135
  • Score
    100M100P100Q134491F
  • License MIT

SuperAgent driven library for testing HTTP servers

Package Exports

  • supertest-with-proxy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (supertest-with-proxy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

SuperTest Proxy Solution

About

This module is proxy solution for supertest

Getting Started

Install SuperTest as an npm module and save it to your package.json file as a development dependency:

npm install supertest-with-proxy --save-dev

Once installed it can now be referenced by simply calling require('supertest-with-proxy');

Proxy Example

const request = require('supertest-with-proxy');
const express = require('express');

const app = express();

app.get('/user', function(req, res) {
  res.status(200).json({ name: 'john' });
});

request(app)
  .get('/user')
  .proxy('http://example.com')
  .expect('Content-Type', /json/)
  .expect('Content-Length', '15')
  .expect(200)
  .end(function(err, res) {
    if (err) throw err;
  });

For complete documentation, refer supertest