How to use the supertest/lib/test.prototype function in supertest

To help you get started, we’ve selected a few supertest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github the-control-group / authx / test / init / 2. app.js View on Github external
'use strict';

import Promise from 'bluebird';
import Test from 'supertest/lib/test';
Test.prototype.end = Promise.promisify(Test.prototype.end);

import supertest from 'supertest';

import Koa from 'koa';
import AuthX, { EmailStrategy, GoogleStrategy, PasswordStrategy, SecretStrategy, InContactStrategy } from '../../src/index.js';


module.exports = {
	setup: function(done){
		global.authx = new AuthX(global.setup.config, {
			email: EmailStrategy,
			google: GoogleStrategy,
			password: PasswordStrategy,
			secret: SecretStrategy,
			incontact: InContactStrategy
		});
github Floby / konga-cli / client.js View on Github external
var supertest = require('supertest');
var config = require('./config');

var Test = require('supertest/lib/test');

originalAssert = Test.prototype.assert;
Test.prototype.assert = function kongaAssert(resError, res, fn){
  if (!res && resError) return fn.call(this, resError);
  return originalAssert.call(this, resError, res, fn);
};

var client = supertest(config.kong_url);
module.exports = client;
github Floby / konga-cli / client.js View on Github external
var supertest = require('supertest');
var config = require('./config');

var Test = require('supertest/lib/test');

originalAssert = Test.prototype.assert;
Test.prototype.assert = function kongaAssert(resError, res, fn){
  if (!res && resError) return fn.call(this, resError);
  return originalAssert.call(this, resError, res, fn);
};

var client = supertest(config.kong_url);
module.exports = client;

supertest

SuperAgent driven library for testing HTTP servers

MIT
Latest version published 6 months ago

Package Health Score

84 / 100
Full package analysis