diff --git a/types/fetch-mock/fetch-mock-tests.ts b/types/fetch-mock/fetch-mock-tests.ts index 4593933aef..63381591b9 100644 --- a/types/fetch-mock/fetch-mock-tests.ts +++ b/types/fetch-mock/fetch-mock-tests.ts @@ -111,6 +111,9 @@ 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.post("http://test.com", 200, {method: "POST", body: "abc"}); +fetchMock.post("http://test.com", 200, {method: "POST", body: {foo: "bar"}}); +fetchMock.post("http://test.com", 200, {method: "POST", body: ["foo", "bar"]}); fetchMock.put("http://test.com", 200, {method: "PUT"}); fetchMock.delete("http://test.com", 200, {method: "DELETE"}); fetchMock.head("http://test.com", 200, {method: "HEAD"}); diff --git a/types/fetch-mock/index.d.ts b/types/fetch-mock/index.d.ts index aa73960ca5..5900068e59 100644 --- a/types/fetch-mock/index.d.ts +++ b/types/fetch-mock/index.d.ts @@ -144,6 +144,11 @@ declare namespace fetchMock { */ headers?: { [key: string]: string | number }; + /** + * body to match + */ + body?: string | {}; + /** * key/value map of query strings to match, in any order */