mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[fetch-mock] Add Mock Configuration Options
This commit is contained in:
parent
716c8476f3
commit
0dde12db1f
@ -61,6 +61,7 @@ fetchMock.patch("http://test.com", 200);
|
||||
fetchMock.patchOnce("http://test.com", 200);
|
||||
|
||||
fetchMock.get("http://test.com", 200, {method: "GET"});
|
||||
fetchMock.get("http://test.com", 200, {method: "GET", overwriteRoutes: true});
|
||||
fetchMock.post("http://test.com", 200, {method: "POST"});
|
||||
fetchMock.put("http://test.com", 200, {method: "PUT"});
|
||||
fetchMock.delete("http://test.com", 200, {method: "DELETE"});
|
||||
|
||||
7
types/fetch-mock/index.d.ts
vendored
7
types/fetch-mock/index.d.ts
vendored
@ -5,6 +5,7 @@
|
||||
// Risto Keravuori <https://github.com/merrywhether>
|
||||
// Chris Sinclair <https://github.com/chrissinclair>
|
||||
// Matt Tennison <https://github.com/matttennison>
|
||||
// Quentin Bouygues <https://github.com/quentinbouygues>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@ -120,6 +121,12 @@ declare namespace fetchMock {
|
||||
* as specified above
|
||||
*/
|
||||
matcher?: MockMatcher;
|
||||
/**
|
||||
* This option allows for existing routes in a mock to be overwritten.
|
||||
* It’s also possible to define multiple routes with ‘the same’ matcher.
|
||||
* Default behaviour is to error
|
||||
*/
|
||||
overwriteRoutes?: boolean;
|
||||
/**
|
||||
* as specified above
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user