jest-util
30.5.1 · 1 Sep 2026MIT156.2M / weekRepositoryHomepagenpmAtom feed
30.5.1 is the newest release of 30.x.
In short
16 new21 fixed2 internal
Release note
Big release! 😀
Main feature is a rewrite of our custom runtime in preparation for stabilisation of native support of ESM. As part of that work require(esm) module is now supported on Node 24.9+ (still requires --experimental-vm-modules like before).
In addition we now support fake timers for the recently released Temporal API in Node v26.
React 19 is also supported properly in pretty-format, meaning snapshots of React components now work like they should.
Due to all the changes, there might be regressions that snuck in. Please report them!
Full list of changes below
Features
babel-jest: Support collecting coverage from
.mts,.cts(and other) files[jest-circus, jest-cli, jest-config, jest-core, jest-jasmine2, jest-types]Add--collect-testsflag to discover and list tests without executing themjest-config, jest-runner, jest-worker: Add
workerGracefulExitTimeoutconfig option to control how long workers are given to exit before being force-killedjest-config: Add support for
jest.config.mtsas a valid configuration file[jest-config, jest-core, jest-reporters, jest-runner]verboseandsilentcan now be set per-project; the project-level value overrides the global value for that project's tests@jest/fake-timers: Accept
Temporal.Durationinjest.advanceTimersByTime()andjest.advanceTimersByTimeAsync()@jest/fake-timers: Accept
Temporal.InstantandTemporal.ZonedDateTimeinjest.setSystemTime()anduseFakeTimers({now})@jest/fake-timers: Support faking
Temporal.Now.*jest-mock: Add
clearMocksOnScope(scope)onModuleMockerfor clearing every mock function exposed on a scope objectjest-resolve: Add
canResolveSync()onResolverso callers can detect when a user-configured resolver only exports anasynchookjest-runtime: Use synchronous
evaluate()for ES modules without top-levelawaiton Node versions that support it (v24.9+), and prefer the synchronous transform path when a sync transformer is configuredjest-runtime: Support
require()of ES modules on Node v24.9+jest-runtime: Validate TC39 import attributes (
with { type: 'json' }) on ESM imports@jest/transform: Add
canTransformSync(filename)onScriptTransformerso callers can pick the sync vs async transform pathjest-util: Add
isErrorhelperpretty-format: Support React 19
Fixes
expect-utils: Fix
toStrictEqualfailing onstructuredCloneresults due to cross-realm constructor mismatch@jest/expect-utils: Prevent
toMatchObject/subset matching from throwing when encountering exotic iterablesfake-timers: Convert
Dateto milliseconds before passing to@sinonjs/fake-timersjest: Export
GlobalConfigandProjectConfigTypeScript typesjest-circus: Prevent crash when
asyncErroris undefined for non-Error throwsjest-circus, jest-jasmine2: Include
Error.causein JSONfailureMessagesoutputjest-config: Fix preset path resolution on Windows when the preset uses subpath
exportsjest-config: Allow
collectCoverageandcoverageProviderin project config without a validation warningjest-config: Project config validator now emits "is not supported in an individual project configuration" instead of "probably a typing mistake" for known global-only options
jest-environment-node: Fix
--localstorage-filewarning on Node 25+jest-reporters: Apply global coverage threshold to unmatched pattern files in addition to glob/path thresholds
[jest-reporters, jest-runner, jest-runtime, jest-transform]Fix coverage report not showing correct code coverage when usingprojectsconfig optionjest-runtime: Resolve
expectand@jest/expectfrom the internal module registry so test-file imports share the sameJestAssertionErroras the globalexpectjest-runtime: Improve CJS-from-ESM interop:
__esModule/Babel default unwrap, broader named-export coverage, and shared CJS singleton across importersjest-runtime: Load
.jsfiles with ESM syntax but no"type":"module"marker as native ESMjest-runtime: Extend the
.js-with-ESM-syntax fallback torequire()on Node v24.9+ - falls back torequire(esm)when the CJS parser rejects ESM syntaxjest-runtime: Fix deadlocks and double-evaluation in concurrent ESM and wasm imports
jest-runtime: Fix error when
require()is called after the Jest environment has been torn downjest-runtime: Fix missing error when
import()is called after the Jest environment has been torn downjest-runtime: Fix virtual
unstable_mockModuleregistrations not respected in ESMjest-runtime: Apply
moduleNameMapperwhen resolving modules withrequire.resolve()and thepathsoption