Skip to content

Commit

Permalink
Support asymmetricMatch
Browse files Browse the repository at this point in the history
  • Loading branch information
joebowbeer authored May 23, 2020
1 parent 87c9c4c commit 1a22ea2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ interface MockAdapterOptions {
onNoMatch?: 'passthrough';
}

interface AsymmetricMatcher {
asymmetricMatch: Function;
}

interface RequestDataMatcher {
[index: string]: any;
params?: {
Expand All @@ -38,10 +42,14 @@ interface HeadersMatcher {
[header: string]: string;
}

type AsymmetricHeadersMatcher = AsymmetricMatcher | HeadersMatcher;

type AsymmetricRequestDataMatcher = AsymmetricMatcher | RequestDataMatcher;

type RequestMatcherFunc = (
matcher?: string | RegExp,
body?: string | RequestDataMatcher,
headers?: HeadersMatcher
body?: string | AsymmetricRequestDataMatcher,
headers?: AsymmetricHeadersMatcher
) => RequestHandler;

declare class MockAdapter {
Expand Down

0 comments on commit 1a22ea2

Please sign in to comment.