mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
fetch-mock: Add type for matching headers.
This commit is contained in:
@@ -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);
|
||||
|
||||
4
types/fetch-mock/index.d.ts
vendored
4
types/fetch-mock/index.d.ts
vendored
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user