fetch-mock-jest icon indicating copy to clipboard operation
fetch-mock-jest copied to clipboard

when using delay and jest modern fakeTimers it seems to be using a real delay

Open trajano opened this issue 1 year ago • 1 comments

I was trying to introduce a "delay" on the processing for the response so I used the { delay } option. But noticed my timings are getting randomized.

Upon closer inspection it seemed that there was a real delay once I increased the amount of time I was processing. So it is not respecting the modern jest.useFakeTimers

Ideally I was hoping it will use the setTimeout that is provided by jest so I can control the behaviour, but it is using the real thing.

trajano avatar Dec 18 '22 03:12 trajano