Skip to content

Commit

Permalink
updated types to support delay option
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Oct 27, 2019
1 parent 61cade8 commit 2257739
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/fetch-mock-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ fetchMock.mock("http://test.com", 200, {
fetchMock.mock("http://test.com", 200, {
repeat: 2
});
fetchMock.mock("http://test.com", 200, {
delay: 10
});
fetchMock.mock(/test\.com/, 200);
fetchMock.mock(() => true, 200);
fetchMock.mock((url, opts) => true, 200);
Expand Down
6 changes: 6 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ declare namespace fetchMock {
*/
repeat?: number;

/**
* integer, n, delays responding for the number of milliseconds
* specified.
*/
delay?: number;

/**
* Convert objects into JSON before delivering as stub responses. Can
* be useful to set to false globally if e.g. dealing with a lot of
Expand Down

0 comments on commit 2257739

Please sign in to comment.