diff --git a/types/fetch-mock/fetch-mock-tests.ts b/types/fetch-mock/fetch-mock-tests.ts index cfd595cb16..459c8e1076 100644 --- a/types/fetch-mock/fetch-mock-tests.ts +++ b/types/fetch-mock/fetch-mock-tests.ts @@ -1,6 +1,11 @@ import * as fetchMock from "fetch-mock"; fetchMock.mock("http://test.com", 200); +fetchMock.mock("http://test.com", 200, { + headers: { + test: "header" + } +}); fetchMock.mock(/test\.com/, 200); fetchMock.mock(() => true, 200); fetchMock.mock((url, opts) => true, 200); diff --git a/types/fetch-mock/index.d.ts b/types/fetch-mock/index.d.ts index b8c47b1e97..13563277b4 100644 --- a/types/fetch-mock/index.d.ts +++ b/types/fetch-mock/index.d.ts @@ -96,6 +96,10 @@ declare namespace fetchMock { * http method to match */ method?: string; + /** + * key/value map of headers to match + */ + headers?: { [key: string]: string }; /** * as specified above */