Open
Description
openedon Nov 10, 2024
Version
29.7.0
Steps to reproduce
Steps:
- Clone my repo at https://github.com/ensconced/jest-do-not-fake-bug
npm install
npm test
Expected behavior
Both tests should pass.
Actual behavior
One of the tests times out.
Additional context
It seems like when you include all the available options in doNotFake
, like this:
jest.useFakeTimers({
doNotFake: [
"Date",
"hrtime",
"nextTick",
"performance",
"queueMicrotask",
"requestAnimationFrame",
"cancelAnimationFrame",
"requestIdleCallback",
"cancelIdleCallback",
"setImmediate",
"clearImmediate",
"setInterval",
"clearInterval",
"setTimeout",
"clearTimeout",
],
});
...it's equivalent to doing this:
jest.useFakeTimers();
...whereas it should be equivalent to not faking timers at all.
Environment
System:
OS: macOS 14.4
CPU: (8) arm64 Apple M1 Pro
Binaries:
Node: 20.9.0 - ~/.local/state/fnm_multishells/83672_1731248039013/bin/node
npm: 10.1.0 - ~/.local/state/fnm_multishells/83672_1731248039013/bin/npm
pnpm: 9.9.0 - /opt/homebrew/bin/pnpm
npmPackages:
jest: ^29.7.0 => 29.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment