Skip to content

Commit

Permalink
test(mockMiddleware): fix timing
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhck authored Oct 9, 2020
1 parent 1ec3283 commit f60abae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares/MockMiddleware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe("MockMiddleware", () => {
MockMiddleware.resolvingPromise({ mock: true }, 50).then(spy);
jest.advanceTimersByTime(49);
expect(spy).not.toHaveBeenCalled();
jest.advanceTimersByTime(51);
jest.advanceTimersByTime(1);
// this is required because even though it's advanced by time, Promise is on kinda background, we need to kick off promise chain
await Promise.resolve();
expect(spy).toHaveBeenCalled();
Expand Down

0 comments on commit f60abae

Please sign in to comment.