diff --git a/types/fetch-mock/fetch-mock-tests.ts b/types/fetch-mock/fetch-mock-tests.ts index b265e1c33f..1d5c5a51b3 100644 --- a/types/fetch-mock/fetch-mock-tests.ts +++ b/types/fetch-mock/fetch-mock-tests.ts @@ -62,6 +62,7 @@ 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.get("http://test.com", 200, {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"}); diff --git a/types/fetch-mock/index.d.ts b/types/fetch-mock/index.d.ts index 891fb0ec7b..fdae338fce 100644 --- a/types/fetch-mock/index.d.ts +++ b/types/fetch-mock/index.d.ts @@ -6,6 +6,7 @@ // Chris Sinclair // Matt Tennison // Quentin Bouygues +// Fumiaki Matsushima // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -165,23 +166,23 @@ declare namespace fetchMock { } interface MockOptionsMethodGet extends MockOptions { - method: 'GET'; + method?: 'GET'; } interface MockOptionsMethodPost extends MockOptions { - method: 'POST'; + method?: 'POST'; } interface MockOptionsMethodPut extends MockOptions { - method: 'PUT'; + method?: 'PUT'; } interface MockOptionsMethodDelete extends MockOptions { - method: 'DELETE'; + method?: 'DELETE'; } interface MockOptionsMethodHead extends MockOptions { - method: 'HEAD'; + method?: 'HEAD'; } interface FetchMockStatic {