fake-timers 7 doesn't seem to forward setTimeout args
See original GitHub issuesetTimeout((foo) => {
console.log(foo) // should log "hello"
}, 1, 'hello')
Refs: https://github.com/nodejs/undici/pull/675#issuecomment-812918698
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:23 (20 by maintainers)
Top Results From Across the Web
doc : jest fake timers : expect on setTimeout not working # ...
I feel that the timer function used is an implementation detail, and that you would get more robust tests by instead looking at...
Read more >Jest: Timer and Promise don't work well. (setTimeout and ...
This seems to be the best answer on the topic of mixing promises with Jest fake timers, but I don't understand it at...
Read more >When using Sinon's useFakeTimers, access the real time ...
I'm using Sinon's useFakeTimers to test a time-dependent module. When in "fake time" mode, I need to use the real setTimeout, meaning that...
Read more >Timer Mocks
In the following example we enable fake timers by calling jest.useFakeTimers() . This is replacing the original implementation of setTimeout() ...
Read more >Testing setTimeout/setInterval
Front -End Testing Patterns (7 Part Series) ... var id = windowSetTimeout.apply(this, arguments) timeoutIds.push(id); return id; }; window.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@benjamingr I updated your Twitter link. The underscore was left out (by Github/Markdown) when clicking, which made me wonder why you were speaking Spanish and just posting Samsung holiday offers 😄
See same link:
I can open a PR if you want.