@jest/pattern
30.5.0 · 28 Aug 2026MIT57M / weekRepositoryHomepagenpmAtom feed
30.5.0 is the newest release of 30.x.
In short
27 breaking1 security39 new3 faster39 fixed19 internal
- breaking
jest-config: Add
mtsandctsto defaultmoduleFileExtensionsconfig - breaking
jest-config: Update
testMatchandtestRegexdefault option for supportingmjs,cjs,mts, andcts - breaking
@jest/core: Changed
--filterto accept an object with shape{ filtered: Array<string> }to match documentation - breaking
- breaking
@jest/environment: Remove deprecated
jest.genMockFromModule() - breaking
@jest/environment: Remove unnecessary defensive code
- breaking
jest-environment-jsdom: Upgrade JSDOM to v22
- breaking
expect, @jest/expect: Add type inference for function parameters in
CalledWithassertions
Release note
Today we are happy to announce the release of Jest 30. This release features a substantial number of changes, fixes, and improvements. While it is one of the largest major releases of Jest ever, we admit that three years for a major release is too long. In the future, we are aiming to make more frequent major releases to keep Jest great for the next decade.
If you want to skip all the news and just get going, run npm install jest@^30.0.0 and follow the migration guide: Upgrading from Jest 29 to 30.
Features
*: Renamed
globalsCleanupModetoglobalsCleanupand--waitNextEventLoopTurnForUnhandledRejectionEventsto--waitForUnhandledRejectionsexpect: Add
ArrayOfasymmetric matcher for validating array elements.babel-jest: Add option
excludeJestPresetto allow opting out ofbabel-preset-jestexpect: Revert #15038 to fix
expect(fn).toHaveBeenCalledWith(expect.objectContaining(...))when there are multiple callsjest-circus, jest-cli, jest-config: Add
waitNextEventLoopTurnForUnhandledRejectionEventsflag to minimise performance impact of correct detection of unhandled promise rejections introducedjest-circus: Add a
waitBeforeRetryoption tojest.retryTimesjest-circus: Add a
retryImmediatelyoption tojest.retryTimesjest-circus, jest-jasmine2: Allow
setupFilesAfterEnvto export an async functionjest-circus, jest-test-result: Add
startedAttimestamp inTestCaseResultObjectwithinonTestCaseResultjest-cli: Export
buildArgv- breaking
jest-config: Add
mtsandctsto defaultmoduleFileExtensionsconfig - breaking
jest-config: Update
testMatchandtestRegexdefault option for supportingmjs,cjs,mts, andcts jest-config: Loads config file from provided path in
package.jsonjest-config: Allow loading
jest.config.ctsfilesjest-config: Show
rootDirin error message when apresetfails to loadjest-config: Support loading TS config files using
esbuild-registervia docblock loaderjest-config: Allow passing TS config loader options via docblock comment
jest-config: If Node is running with type stripping enabled, do not require a TS loader
@jest/core: Group together open handles with the same stack trace (#13417, & #14789)
@jest/core: Add
perfStatsto surface test setup overhead- breaking
@jest/core: Changed
--filterto accept an object with shape{ filtered: Array<string> }to match documentation @jest/core: Support
--outputFileoption for--listTests@jest/core: Stringify Errors properly with
--jsonflag- breaking
@jest/core, @jest/test-sequencer: Exposes
globalConfig&contextstoTestSequencer(#14535, & #14543) jest-each: Introduce
%$option to add number of the test to its title- breaking
@jest/environment: Remove deprecated
jest.genMockFromModule() - breaking
@jest/environment: Remove unnecessary defensive code
- breaking
jest-environment-jsdom: Upgrade JSDOM to v22
@jest/environment-jsdom-abstract: Introduce new package which abstracts over the
jsdomenvironment, allowing usage of custom versions of JSDOMjest-environment-node: Update jest environment with dispose symbols
Symbol(#14888 & #14909)- breaking
expect, @jest/expect: Add type inference for function parameters in
CalledWithassertions @jest/expect-utils: Properly compare all types of
TypedArrays- breaking
@jest/fake-timers: Upgrade
@sinonjs/fake-timersto v13 (#14544 & #15470) @jest/fake-timers: Exposing new modern timers function
advanceTimersToFrame()which advances all timers by the needed milliseconds to execute callbacks currently scheduled withrequestAnimationFramejest-matcher-utils: Add
SERIALIZABLE_PROPERTIESto allow custom serialization of objectsjest-mock: Add support for the Explicit Resource Management proposal to use the
usingkeyword withjest.spyOn(object, methodName)jest-reporters: Add support for DEC mode 2026
jest-resolver: Support
file://URLs as paths[jest-resolve,jest-runtime,jest-resolve-dependencies]Pass the conditions when resolving stub modulesjest-runtime: Exposing new modern timers function
jest.advanceTimersToFrame()from@jest/fake-timersjest-runtime: Support
import.meta.filenameandimport.meta.dirname(available from Node 20.11)jest-runtime: Support
import.meta.resolve- breaking
jest-runtime: Make it mandatory to pass
globalConfigto theRuntimeconstructor jest-runtime: Add
unstable_unmockModulejest-runtime: Add
onGenerateMocktransformer callback for auto generated callbacks (#15433 & #15482)- breaking
jest-runtime: Use
vm.compileFunctionovervm.Script @jest/types:
test.each(): Accept a readonly (as const) table properly@jest/types: Improve argument type inference passed to
testanddescribecallback functions fromeachtables- breaking
jest-snapshot: Add support for Error causes in snapshots
jest-snapshot: Support Prettier 3
@jest/util-snapshot: Extract utils used by tooling from
jest-snapshotinto its own package- breaking
pretty-format: Do not render empty string children (
'') in React plugin
Fixes
expect: Show
AggregateErrorto display*: Replace
exitwithexit-xbabel-plugin-jest-hoist: Use
denylistinstead of the deprecatedblacklistfor Babel 8 supportbabel-plugin-jest-hoist: Do not rely on buggy Babel behaviour
expect: Check error instance type for
toThrow/toThrowErrorexpect: Improve diff for failing
expect.objectContainingexpect: Use
Array.isArrayto check if an array is anArrayexpect: Fix Error
causeassertion errorsjest-changed-files: Print underlying errors when VCS commands fail
jest-changed-files: Abort
sl rootcall if output resembles a steam locomotive- breaking
jest-circus: Prevent false test failures caused by promise rejections handled asynchronously
jest-circus: Replace recursive
makeTestResultsimplementation with iterative onejest-circus: Omit
expect.hasAssertions()errors if a test already has errorsjest-circus, jest-expect, jest-snapshot: Pass
test.failingtests when containing failing snapshot matchersjest-circus: Concurrent tests now emit jest circus events at the correct point and in the expected order.
- breaking
jest-cli: Validate CLI flags that require arguments receives them
jest-config: Make sure to respect
runInBandoptionjest-config: Support
testTimeoutin project configjest-config: Support
coverageReportersin project configjest-config: Allow
reportersin project configjest-config: Allow Node16/NodeNext/Bundler
moduleResolutionin project's tsconfig@jest/create-cache-key-function: Correct the return type of
createCacheKeyjest-each: Allow
$keypathtemplates withnullorundefinedvalues@jest/expect-utils: Fix comparison of
DataView- breaking
@jest/expect-utils: Exclude non-enumerable in object matching
@jest/expect-utils: Fix comparison of
URL@jest/expect-utils: Check
Symbolproperties in equality@jest/expect-utils: Catch circular references within arrays when matching objects
@jest/expect-utils: Fix not addressing to Sets and Maps as objects without keys
jest-haste-map: Fix errors or clobbering with multiple
hasteImplModulePathsjest-leak-detector: Make leak-detector more aggressive when running GC
jest-runtime: Properly handle re-exported native modules in ESM via CJS
jest-runtime: Refactor
_importCoreModelso required core module is consistent if modified while loading- breaking
jest-schemas, jest-types: Fix type of
testFailureExitCodeconfig option jest-util: Make sure
isInteractiveworks in a browser- breaking
pretty-format: Print
ArrayBufferandDataViewcorrectly pretty-format: Fixed a bug where "anonymous custom elements" were not being printed as expected.
jest-cli: When specifying paths on the command line, only match against the relative paths of the test files
[BREAKING] Changes
testPathPatternconfiguration option totestPathPatterns, which now takes a list of patterns instead of the regex.[BREAKING]
--testPathPatternis now--testPathPatterns[BREAKING] Specifying
testPathPatternswhen programmatically callingwatchmust be specified asnew TestPathPatterns(patterns), whereTestPathPatternscan be imported from@jest/pattern
jest-reporters, jest-runner: Unhandled errors without stack get correctly logged to console
jest-util: Always load
mjsfiles withimportjest-worker: Properly handle a circular reference error when worker tries to send an assertion fails where either the expected or actual value is circular
jest-worker: Properly handle a BigInt when worker tries to send an assertion fails where either the expected or actual value is BigInt
expect: Resolve issue where
ObjectContainingmatched non-object values. ([#15463])(#15463).Adds a
conditional/checkto ensure the argument passed toexpectis an object.Add unit tests for new
ObjectContainingbehavior.Remove
invalid/wrongtest case assertions forObjectContaining.
jest-worker: Addresses incorrect state on exit
Performance
- breaking
*: Bundle all of Jest's modules into
index.js(#12348, #14550 & #14661) jest-haste-map: Only spawn one process to check for
watchmaninstallationjest-runner: Better cleanup
source-map-supportafter test to resolve (minor) memory leak[jest-circus, jest-environment-node, jest-repl, jest-runner, jest-util]Cleanup global variables on environment teardown to reduce memory leaks (#15215 & #15636 & #15643)
Chore & Maintenance
- security
[jest-environment-jsdom, jest-environment-jsdom-abstract]Increased version of jsdom to^26.0.0(#15325CVE-2024-37890) - breaking
*: Drop support for Node.js versions 14, 16, 19, 21 and 23 (#14460, #15118, #15623, #15640)
- breaking
*: Drop support for
typescript@4.3, minimum version is now5.4(#14542, #15621) - breaking
*: Add ESM wrapper for all of Jest's modules
- breaking
*: Upgrade to
glob@10 - breaking
babel-jest, babel-preset-jest: Increase peer dependency of
@babel/coreto^7.11 - breaking
expect: Remove
.toBeCalled(),.toBeCalledTimes(),.toBeCalledWith(),.lastCalledWith(),.nthCalledWith(),.toReturn(),.toReturnTimes(),.toReturnWith(),.lastReturnedWith(),.nthReturnedWith()and.toThrowError()matcher aliases - breaking
jest-cli, jest-config, @jest/types: Remove deprecated
--initargument - breaking
jest-mock: Remove
MockFunctionMetadataType,MockFunctionMetadataandSpyInstancetypes