-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Fake timers are broken #2707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Isn't this related? #2467 |
It may be, but:
And with every case result was same I think it's related to jest fn mocking... But I may be wrong |
Are you able to provide a minimal repro for this case? |
Yes, it's here please use |
Thank you! |
Sorry, I've mixed up hacked version with |
Dude, this code is mixing so many of Running |
OMG, that's was actually my fault... Reason was this little line ( diff --git a/src/screens/__tests__/word-answer-test.js b/src/screens/__tests__/word-answer-test.js
index aff822e..d4782e3 100644
--- a/src/screens/__tests__/word-answer-test.js
+++ b/src/screens/__tests__/word-answer-test.js
@@ -17,7 +17,6 @@ describe('WordAnswer', () => {
addAnswer = jest.fn();
submitResult = jest.fn();
nextTask = jest.fn();
- setTimeout.mockReset();
});
fit('should call to next task if some task remaining', () => { Removing it fix my trouble. Thank you for spending time on this issue! |
Glad you solved it! |
Can you show warning when use fakeTimer inside "it"? |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Please take a look:
with

jest.runAllTimers
and with hack

Used jest version is :
I've debugged it a bit ... it seems that
this._ticks is empty
because
_createMocks is calling, but _fakeSetTimeout is not calling.
but jest's tests for FakeTimers are passing for latest jest from master... strange
The text was updated successfully, but these errors were encountered: