Merge pull request #2315 from danrspencer/master

Changed .reply definition to allow objects as for body parameter
This commit is contained in:
Masahiro Wakame
2014-06-12 16:46:46 +09:00
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -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
View File
@@ -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;