supertest-fetch
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var http_1 = __importDefault(require("http")); | ||
var Server_1 = __importDefault(require("./Server")); | ||
@@ -48,3 +49,7 @@ var Test_1 = __importDefault(require("./Test")); | ||
*/ | ||
function makeFetch(server) { | ||
function makeFetch(target) { | ||
// if we were given an express app | ||
var server = target && target.route | ||
? http_1.default.createServer(target) | ||
: target; | ||
if (!server || !server.listen || !server.address || !server.close) { | ||
@@ -51,0 +56,0 @@ throw new Error("Expected server"); |
{ | ||
"name": "supertest-fetch", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Supertest with WHATWG fetch like interface.", | ||
@@ -59,2 +59,3 @@ "main": "lib/index.js", | ||
"@types/chai-as-promised": "^7.1.0", | ||
"@types/express": "^4.16.0", | ||
"@types/mocha": "^5.2.0", | ||
@@ -65,9 +66,10 @@ "@types/node": "^10.0.0", | ||
"coveralls": "^3.0.0", | ||
"express": "^4.16.3", | ||
"husky": "^1.0.0-rc.2", | ||
"lint-staged": "^7.0.5", | ||
"markdownlint-cli": "^0.9.0", | ||
"markdownlint-cli": "^0.12.0", | ||
"mocha": "^5.1.1", | ||
"nyc": "^11.8.0", | ||
"nyc": "^12.0.1", | ||
"semantic-release": "^15.2.0", | ||
"ts-node": "^6.0.1", | ||
"ts-node": "^7.0.0", | ||
"tslint": "^5.9.1", | ||
@@ -74,0 +76,0 @@ "typescript": "^2.8.3", |
/// <reference types="node" /> | ||
/// <reference types="express" /> | ||
import http from 'http'; | ||
import { Express } from 'express'; | ||
import * as nodeFetch from 'node-fetch'; | ||
@@ -29,3 +31,3 @@ import Test from './Test'; | ||
*/ | ||
export declare function makeFetch(server: http.Server): (url: string | nodeFetch.Request, init?: nodeFetch.RequestInit | undefined) => Test; | ||
export declare function makeFetch(target: http.Server | Express): (url: string | nodeFetch.Request, init?: nodeFetch.RequestInit | undefined) => Test; | ||
export { fetch }; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36461
495
19
3