Comparing version 1.1.1 to 1.1.2
/// <reference types="node" /> | ||
import { RequestListener, Server } from 'http'; | ||
import { RequestOptions, Test, BodyType } from "./Test"; | ||
import { RequestOptions, Test, BodyType, RequestResponse } from "./Test"; | ||
export default function fetchtest(app: RequestListener | Server, defaultOptions?: RequestOptions): Test; | ||
export { RequestOptions, BodyType }; | ||
export { RequestOptions, BodyType, RequestResponse }; |
@@ -8,2 +8,9 @@ /// <reference types="node" /> | ||
export declare type BodyType = Record<string, any>; | ||
export declare type RequestResponse = { | ||
headers: Headers; | ||
status: number; | ||
json: any | null; | ||
redirected: boolean; | ||
url: string; | ||
}; | ||
export declare class Test { | ||
@@ -17,37 +24,7 @@ app: Server; | ||
constructor(app: Server, defaultOptions?: RequestOptions); | ||
get(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
headers: Headers; | ||
status: number; | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
delete(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
headers: Headers; | ||
status: number; | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
post(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
headers: Headers; | ||
status: number; | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
put(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
headers: Headers; | ||
status: number; | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
patch(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
headers: Headers; | ||
status: number; | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
get(url: string, body?: BodyType, options?: RequestOptions): Promise<RequestResponse>; | ||
delete(url: string, body?: BodyType, options?: RequestOptions): Promise<RequestResponse>; | ||
post(url: string, body?: BodyType, options?: RequestOptions): Promise<RequestResponse>; | ||
put(url: string, body?: BodyType, options?: RequestOptions): Promise<RequestResponse>; | ||
patch(url: string, body?: BodyType, options?: RequestOptions): Promise<RequestResponse>; | ||
private _makeRequest; | ||
@@ -54,0 +31,0 @@ private static buildResponse; |
{ | ||
"name": "fetchtest", | ||
"description": "A fetch wrapper for express testing", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "dist/lib.js", |
8582
163