From 8d9ed6686dca2bcf0b0f5945c1c6c734273acfde Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Thu, 16 Jul 2015 09:09:31 +1200 Subject: [PATCH] Added support for query (docs: https://github.com/pgte/nock#specifying-request-query-string) --- nock/nock-tests.ts | 3 +++ nock/nock.d.ts | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index 00227dfaf..bc936a05b 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -45,6 +45,9 @@ inst = inst.merge(str, data); inst = inst.merge(str, obj); inst = inst.merge(str, regex); +inst = inst.query(obj); +inst = inst.query(bool); + inst = inst.intercept(str, str); inst = inst.intercept(str, str, str); inst = inst.intercept(str, str, obj); diff --git a/nock/nock.d.ts b/nock/nock.d.ts index b6803ca89..3cd92e65a 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -45,6 +45,9 @@ declare module "nock" { merge(path: string, data?: Object): Scope; merge(path: string, regex?: RegExp): Scope; + query(params: any): Scope; + query(acceptAnyParams: boolean): Scope; + intercept(path: string, verb: string, body?: string, options?: any): Scope; intercept(path: string, verb: string, body?: Object, options?: any): Scope; intercept(path: string, verb: string, body?: RegExp, options?: any): Scope; @@ -55,7 +58,7 @@ declare module "nock" { replyWithFile(responseCode: number, fileName: string): Scope; defaultReplyHeaders(headers: Object): Scope; - + matchHeader(name: string, value: string): Scope; matchHeader(name: string, regex: RegExp): Scope; matchHeader(name: string, fn: (value: string) => boolean): Scope;