question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fake-timers 7 doesn't seem to forward setTimeout args

See original GitHub issue
setTimeout((foo) => {
  console.log(foo) // should log "hello"
}, 1, 'hello')

Refs: https://github.com/nodejs/undici/pull/675#issuecomment-812918698

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:23 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
fatso83commented, Apr 8, 2021

@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:

2reactions
dnlupcommented, Apr 6, 2021

I can open a PR if you want.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found