You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on vitest-dev/vitest#2209 I have an issue with runToLastAsync doing an infinite loop
Below you can find a minimal test to reproduce the issue
We understand you have a problem and are in a hurry, but please provide us with some info to make it much more likely for your issue to be understood, worked on and resolved quickly.
FakeTimers version : 9.1.2
Environment : MACOS
Example URL : a minimial reproduction test
Other libraries you are using: none
What did you expect to happen?
An infinite loop shouldn't be possible and this test shouldn't break
What actually happens
This test times out
How to reproduce
Here is a minimal test to reproduce the issue
it("new timers created from promises cannot cause an infinite loop when a date is given",function(){this.clock=FakeTimers.createClock(Date.now());consttest=this;constspy=sinon.spy();constrecursiveCallback=function(){global.Promise.resolve().then(function(){test.clock.setTimeout(recursiveCallback,0);});};this.clock.setTimeout(recursiveCallback,0);this.clock.setTimeout(spy,100);returnthis.clock.runToLastAsync().then(function(){assert.isTrue(spy.called);});});
The error for this test is
The text was updated successfully, but these errors were encountered:
While working on vitest-dev/vitest#2209 I have an issue with
runToLastAsync
doing an infinite loopBelow you can find a minimal test to reproduce the issue
FakeTimers version : 9.1.2
Environment : MACOS
Example URL : a minimial reproduction test
Other libraries you are using: none
What did you expect to happen?
An infinite loop shouldn't be possible and this test shouldn't break
What actually happens
This test times out
How to reproduce
Here is a minimal test to reproduce the issue
The error for this test is
The text was updated successfully, but these errors were encountered: