@jest/fake-timers
30.5.2 · 18 Sep 2026MIT78.4M / weekRepositoryHomepagenpmAtom feed
27.5.1 is the newest release of 27.x.
In short
47 breaking36 new4 faster36 fixed10 internal
- breaking
jest-circus: Fail tests when multiple
done()calls are made - breaking
jest-circus, jest-jasmine2: Fail the test instead of just warning when describe returns a value
- breaking
jest-config: Default to Node testing environment instead of browser (JSDOM)
- breaking
jest-config: Use
jest-circusas default test runner - breaking
- breaking
[jest-config, jest-haste-map, jest-resolve, jest-runner, jest-runtime, jest-test-sequencer, jest-transform, jest-types]Add custom HasteMap class implementation config option - breaking
jest-repl, jest-runner: Run transforms over environment
- breaking
jest-runner: Set exit code to 1 if test logs after teardown
Release note
Features
babel-jest: Add async transformation
jest-changed-files: Use '--' to separate paths from revisions
- breaking
jest-circus: Fail tests when multiple
done()calls are made - breaking
jest-circus, jest-jasmine2: Fail the test instead of just warning when describe returns a value
- breaking
jest-config: Default to Node testing environment instead of browser (JSDOM)
- breaking
jest-config: Use
jest-circusas default test runner jest-config: Add support for
presetwritten in ESMjest-config, jest-runtime: Support ESM for files other than
.jsand.mjs- breaking
jest-config, jest-runtime: Use "modern" implementation as default for fake timers (#10874 & #11197)
[jest-configAllow passingforceNodeFilesystemAPIthrough tojest-haste-map- breaking
[jest-config, jest-haste-map, jest-resolve, jest-runner, jest-runtime, jest-test-sequencer, jest-transform, jest-types]Add custom HasteMap class implementation config option jest-core: Make
TestWatcherextendemitteryjest-core: Run failed tests interactively the same way we do with snapshots
jest-core: More
TestSequencermethods can be asyncjest-core: Add support for
testSequencerwritten in ESMjest-core: Add support for
globalSetupandglobalTeardownwritten in ESMjest-core: Add support for
watchPluginswritten in ESMjest-core: Add support for
runnerwritten in ESMjest-core: Add support for
reporterswritten in ESMjest-each: Add support for interpolation with object properties
jest-environment-node: Add AbortController to globals
@jest/fake-timers: Update to
@sinonjs/fake-timersto v7jest-haste-map: Handle injected scm clocks
jest-haste-map: Add
enableSymlinksconfiguration option to follow symlinks for test files- breaking
jest-repl, jest-runner: Run transforms over environment
jest-repl: Add support for
testEnvironmentwritten in ESM- breaking
jest-runner: Set exit code to 1 if test logs after teardown
- breaking
jest-runner: Run transforms over
runnner - breaking
jest-runner: Run transforms over
testRunnner jest-runner: Possibility to use ESM for test environment (11033)
jest-runner: Add support for
testRunnerwritten in ESMjest-runtime: Detect reexports from CJS as named exports in ESM
jest-runtime: Support for async code transformations (#11191 & #11220)
jest-reporters: Add static filepath property to all reporters
- breaking
jest-snapshot: Make prettier optional for inline snapshots - fall back to string replacement (#7792 & #11192)
- breaking
jest-snapshot: Run transforms over
snapshotResolver jest-transform: Pass config options defined in Jest's config to transformer's
processandgetCacheKeyfunctionsjest-transform: Add support for transformers written in ESM
- breaking
jest-transform: Do not export
ScriptTransformerclass, instead export the async functioncreateScriptTransformer jest-transform: Async code transformations
jest-transform: Support transpiled transformers
- breaking
jest-transform:
requireAndTranspileModulealways return aPromise, and the third parameter type is changed toRequireAndTranspileModuleOptionswhich acceptapplyInteropRequireDefaultoption - breaking
jest-transform:
createTranspilingRequirereturn function which return aPromisenow jest-util: Add requireOrImportModule for importing CJS or ESM
jest-util: Add
applyInteropRequireDefaultoption onrequireOrImportModulejest-watcher: Added support for clearing the line when
<C-u>is pressed in a watch mode pattern promptjest-worker: Add support for custom task queues and adds a
PriorityQueueimplementation.jest-worker: Add in-order scheduling policy to jest worker (10902)
pretty-format: Better print for sparse arrays (11326)
pretty-print: Add option
printBasicPrototypewhich determines whether or not the prototype should be printed for raw objects or arrays
Fixes
babel-plugin-jest-hoist: Add
__dirnameand__filenameto whitelisted globals- breaking
expect: Revise
expect.not.objectContaining()to be the inverse ofexpect.objectContaining(), as documented. - breaking
expect: Make
toContainmore strict with the received type (#10119 & #10929) - breaking
expect:
matcherResultonJestAssertionErrorare now strings rather than functions jest-circus: Fixed the issue of beforeAll & afterAll hooks getting executed even if it is inside a skipped
describeblock #10451jest-circus: Fix
testLocationon Windows when usingtest.eachjest-cli: Use testFailureExitCode when bailing from a failed test
jest-cli: Print custom error if error thrown from global hooks is not an error already
jest-cli: Allow running multiple "projects" from programmatic API
jest-cli: Fix missing collectCoverage after init
jest-cli, jest-config, jest-types: Move all default values into
jest-config- breaking
jest-config: Change default file extension order by moving json behind ts and tsx (10572)
jest-console:
console.dirnow respects the second argument correctlyjest-core: Don't report PerformanceObserver as open handle
jest-core: Use
WeakRefto hold timers when detecting open handlesjest-core: Correctly detect open handles that were created in test functions using
donecallbacksjest-core: Do not collect
RANDOMBYTESREQUESTas open handlesjest-core: Wait briefly for open handles to close before flagging them when using
--detectOpenHandles- breaking
jest-diff: Use only named exports
- breaking
jest-each: Ignore excess words in headings
jest-each: Support array index with template strings
jest-each: Interpolate
%%correctlyjest-each: Fix wrong interpolation when the value of array contains multiple
%- breaking
jest-environment: Drop support for
runScriptfor test environments jest-environment-jsdom: Use inner realm’s
ArrayBufferconstructor- breaking
jest-environment-jsdom: Remove Node globals
setImmediateandclearImmediate#11222 - breaking
jest-get-type: Convert to ES Module
- breaking
jest-globals: Disallow return values other than a
Promisefrom hooks and tests - breaking
jest-globals: Disallow mixing a done callback and returning a
Promisefrom hooks and tests jest-haste-map: Vendor
NodeWatcherfromsanejest-jasmine2: Fixed the issue of
beforeAll&afterAllhooks getting executed even if it is inside a skippeddescribeblock when it has childtestsmarked as eitheronlyortodo#10451jest-jasmine2: Fixed the issues of child
testsmarked withonlyortodogetting executed even if it is inside a skipped parentdescribeblock #10451jest-jasmine2: Wrap all test functions so they open handles that were created in test functions using
donecallbacks can be detectedjest-reporter: Handle empty files when reporting code coverage with V8
jest-resolve: Replace read-pkg-up with escalade package
jest-resolve: Disable
jest-pnp-resolverfor Yarn 2- breaking
jest-runtime: Do not inject
globalvariable into module wrapper - breaking
jest-runtime: Remove long-deprecated
jest.addMatchers,jest.resetModuleRegistry, andjest.runTimersToTime jest-runtime: Fix stack overflow and promise deadlock when importing mutual dependant ES module
jest-runtime: Prevent global module registry from leaking into
isolateModulesregistryjest-runtime: Refactor to prevent race condition when linking and evaluating ES Modules
jest-runtime: Throw correct error when attempting to load ESM via
requirejest-runtime: Do not cache modules that throw during evaluation
jest-transform: Show enhanced
SyntaxErrormessage for allSyntaxErrors- breaking
jest-transform: Refactor API to pass an options bag around rather than multiple boolean options
- breaking
jest-transform: Refactor API of transformers to pass an options bag rather than separate
configand other options jest-types: Fix
Config.tsprojectstypesjest-util: Replace micromatch with picomatch to fix issues with negated globs
jest-validate: Use
en-USlocale to avoid case conversion problems while validating CLI options on machines with some certain locales(e.g. Turkish) set as default locale.- breaking
jest-worker: Use named exports
jest-worker: Do not swallow errors during serialization
jest-worker: Handle
ERR_IPC_CHANNEL_CLOSEDerrors properly- breaking
pretty-format: Convert to ES Modules
pretty-format: Only call
hasAttributeif it's a functionpretty-format: Handle jsdom attributes properly
pretty-format: Import pretty-format using named imports
Chore & Maintenance
- breaking
*: Only support Node LTS releases and Node 15
- breaking
*: Add
exportsfield to allpackage.jsons - breaking
*: Remove deprecated
mapCoverage - breaking
babel-jest: Migrate to ESM
- breaking
jest, jest-core: Replace
TestSchedulerexport withcreateTestScheduler - breaking
jest-config: Remove
enabledTestsMapconfig, usefilterinstead - breaking
jest-console: Move
rootintoconfigand takeGlobalConfigas mandatory parameter forgetConsoleOutput - breaking
jest-haste-map: Migrate to ESM
- breaking
jest-haste-map: Remove support for deprecated option
ignorePatternas function - breaking
jest-jasmine2: Migrate to ESM
- breaking
jest-jasmine2: Remove unused options argument from
Envconstructor - breaking
jest-repl, jest-runtime: Move the
jest-runtimeCLI intojest-repl(#10016 & #10925) - breaking
jest-resolve: Migrate to ESM
- breaking
jest-resolve-dependencies: Migrate to ESM
- breaking
jest-mock: Migrate to ESM
- breaking
jest-reporters: Make
node-notifiera peer dependency - breaking
jest-resolve, jest-runtime: Use
Maps instead of objects for all cached resources - breaking
jest-runner: Migrate to ESM
- breaking
jest-runtime: Remove deprecated and unused
getSourceMapInfofrom Runtime - breaking
jest-transformer: Remove unused
isCoreModuleoption - breaking
jest-validate: Remove
recursiveBlacklistoption in favor of previously introducedrecursiveDenylist
Performance
jest-resolve: Cache reading and parsing of
package.jsonsjest-runtime, jest-transform: Share
cacheFSbetween runtime and transformerjest-runtime: Load
chalkonly once per workerjest-worker: Fix memory leak of previous task arguments while no new task is scheduled