-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
docs: fix setTimeout example #11974
docs: fix setTimeout example #11974
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't see this was duplicated 😆 Thanks for pointing out the files 🙌 |
@@ -25,6 +25,7 @@ module.exports = timerGame; | |||
'use strict'; | |||
|
|||
jest.useFakeTimers(); | |||
jest.spyOn(global, 'setTimeout'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also changed this one but let me know if I should remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, good catch! that's correct 🙂
Codecov Report
@@ Coverage Diff @@
## main #11974 +/- ##
=======================================
Coverage 68.74% 68.74%
=======================================
Files 323 323
Lines 16649 16649
Branches 4805 4805
=======================================
Hits 11445 11445
Misses 5171 5171
Partials 33 33 Continue to review full report at Codecov.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Based on #11447 (comment)
Summary
Without this snippets jest will error that
setTimeout
is not a mockTest plan