mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 04:24:30 +08:00
Merge pull request #3633 from Nemo157/nock-match-header-regex
Nock match header regex
This commit is contained in:
@@ -72,7 +72,10 @@ inst = inst.twice();
|
||||
inst = inst.thrice();
|
||||
|
||||
inst = inst.defaultReplyHeaders(value);
|
||||
|
||||
inst = inst.matchHeader(str, str);
|
||||
inst = inst.matchHeader(str, regex);
|
||||
inst = inst.matchHeader(str, (val: string) => true);
|
||||
|
||||
inst = inst.delay(num);
|
||||
inst = inst.delayConnection(num);
|
||||
@@ -105,4 +108,4 @@ nock.recorder.rec({
|
||||
});
|
||||
|
||||
strings = nock.recorder.play();
|
||||
objects = nock.recorder.play();
|
||||
objects = nock.recorder.play();
|
||||
|
||||
3
nock/nock.d.ts
vendored
3
nock/nock.d.ts
vendored
@@ -55,7 +55,10 @@ 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;
|
||||
|
||||
filteringPath(regex: RegExp, replace: string): Scope;
|
||||
filteringPath(fn: (path: string) => string): Scope;
|
||||
|
||||
Reference in New Issue
Block a user