mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Changed .reply definition to allow objects as for body parameter
This commit is contained in:
@@ -7,6 +7,7 @@ var str: string;
|
||||
var bool: boolean;
|
||||
var data: string;
|
||||
var num: number;
|
||||
var obj: {};
|
||||
var value: any;
|
||||
var regex: RegExp;
|
||||
var options: nock.Options;
|
||||
@@ -29,7 +30,9 @@ inst = inst.intercept(str, str, str, value);
|
||||
|
||||
inst = inst.reply(num);
|
||||
inst = inst.reply(num, str);
|
||||
|
||||
inst = inst.reply(num, str, headers);
|
||||
inst = inst.reply(num, obj, headers);
|
||||
inst = inst.reply(num, (uri: string, body: string) => {
|
||||
return str;
|
||||
});
|
||||
|
||||
1
nock/nock.d.ts
vendored
1
nock/nock.d.ts
vendored
@@ -23,6 +23,7 @@ declare module "nock" {
|
||||
intercept(path: string, verb: string, body?: string, options?: any): Scope;
|
||||
|
||||
reply(responseCode: number, body?: string, headers?: Object): Scope;
|
||||
reply(responseCode: number, body?: Object, headers?: Object): Scope;
|
||||
reply(responseCode: number, callback: (uri: string, body: string) => string, headers?: Object): Scope;
|
||||
replyWithFile(responseCode: number, fileName: string): Scope;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user