chore(deps): update jest monorepo to v30 (major) #112
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
renovate-bot
renovate-security
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mCaptcha/pow_sha256-polyfill!112
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/major-jest-monorepo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^29.5.6->^30.0.0^29.7.0->^30.0.0Release Notes
jestjs/jest (jest)
v30.5.1Compare Source
Fixes
[jest-config]Don't warn about global-only options in the config that supplies the global config - the root config a project resolves to, or the first entry of--projectswhen no root config is passed (#16411)[jest-config, jest-types]Stop acceptingreporters,coverageReporters,workerIdleMemoryLimit,cwdandrunnerOptionsin a project config - they were silently ignored, and now warn like the other global-only options (#16411)[jest-config, jest-validate]Warn aboutmaxWorkersandcoverageThresholdin a project config instead of dropping them without a word (#16411)[jest-resolve]MatchmoduleNameMapperpatterns against the specifier as written again (reverting #16390) (#16417)[jest-runtime]Resolve packageimportsspecifiers like#depunder ESM again (#16413)Chore & Maintenance
[jest-util]Name thetestEnvironmentOptions.globalsCleanupoption and link the docs from theJEST-01deprecation warning, and document the option's modes (#16404)v30.5.0Compare Source
Features
[@jest/expect-utils, jest-mock]AddmockFn.whenCalledWith(...args)for configuring return values per argument list, with first-class asymmetric-matcher support (#16053)[@jest/expect-utils]ExportAsymmetricMatcherandFunctionParameterstypes (previously private toexpect) (#16053)[jest-circus, jest-core, jest-jasmine2, jest-test-result, jest-types]--collectTestsnow expandstest.each/describe.eachcases and reports per-status counts (skipped/todo via the newwouldRunflag for selected tests) plus a summary line that match a real run, including under--testNamePatternand.only/fdescribefocus on both the circus and jasmine2 runners (#16259)[jest-circus, jest-environment, jest-runtime, jest-types]Add describe-level retries viajest.retryTimes(..., {entireDescribe: true})(#16322)[jest-circus, jest-message-util, jest-reporters, jest-types]AddretryMessagestoAssertionResultand exportformatErrorStack, so the retry log renders nestedcauseandAggregateErrorsections with code frames instead of serialized[cause]:/[errors]:markers (#16316)[jest-circus, jest-types]AddunhandledErrorsDetailedtoCircus.RunResult, so an unhandled rejection reports itscausechain andAggregateErrorentries with code frames instead of a pre-serialized stack (#16316)[jest-haste-map]ReplaceNodeWatcherandFSEventsWatcherwith@parcel/watcherfor the non-watchman watch path (#16188)[jest-resolve]Bumpunrs-resolverto 1.12.1, removejest-pnp-resolverand unnecessary checks (#15721)[jest-resolve]Honor Node's--preserve-symlinks/NODE_PRESERVE_SYMLINKSin the default resolver by passingsymlinks: falsetounrs-resolver(#16260)[jest-runtime]Apply automocking and manual__mocks__files to synchronously evaluable ESM graphs on Node 24.9+ - static imports, dynamicimport()andrequire()of an ESM file now generate an automock from the real module's namespace instead of failing with "Attempting to import a mock without a factory". Graphs that need async evaluation (top-level await) or an async-only resolver or transformer still throw (#16391)[jest-runtime]Routeprocess.getBuiltinModulethrough the sandbox, so it returns the sandboxprocessand the hookednode:moduleinstead of the host's (#16391)[jest-runtime]Throw an actionable error frommodule.register()andmodule.registerHooks()inside a test - the hooks attached to the loader running Jest itself, never saw the sandboxed requires they were meant for, and stayed registered for every later test file in the worker (#16391)[jest-runtime]Surface resolution and import-attribute errors in an ESM graph before executing any of its CJS dependencies on Node 24.9+, matching Node's run-nothing-on-a-broken-graph behavior; the legacy loader on older versions keeps its linking-time execution order (#16391)[jest-runtime]ThrowERR_SOURCE_PHASE_NOT_DEFINEDwith an actionable message forimport sourceandimport.source(), instead of failing at instantiation with V8's bare "Source phase import object is not defined" (#16391)[jest-runtime]Emit the JSON-without-import-attribute deprecation warning once per test file instead of once per worker, so it is no longer silently swallowed for every file after the first (#16391)[jest-runtime]Setimport.meta.maintotruein the test file andfalsein every module it loads, matching Node 24+ (#16367)[jest-runtime]Resolve themodule-syncexport condition, so a package that exposes its ESM entry point forrequire()loads the same file Node would (#16336)[jest-snapshot]Add external snapshot paths to custom reporter failure details (#16374)Fixes
[jest-console, jest-reporters]CustomConsolenow buffers console output soTestResult.consoleis populated for reporters whenverboseis enabled, whileGitHubActionsReporteravoids replaying buffered output in verbose mode (#16155)[expect, jest-message-util, jest-pattern, jest-regex-util, jest-util]Revertnode:protocol imports to restore webpack/browser-bundle compatibility (#16167)[expect]WidentoMatchObjectandobjectContainingparameter type fromRecord<string, unknown>toobjectso class instances are accepted (#16196)[jest-circus]Call a generator test body with the shared test context, sothismatches what a regular test function receives (#16347)[jest-circus]Capture the error listeners of the parent process instead of the in-sandboxprocess, so listeners registered before the test file survive teardown and sandbox listeners no longer leak onto the parent (#16347)[jest-circus]ClearcurrentlyRunningTestafter skipped and todo tests (#16342)[jest-circus]Prevent latedone()callbacks from affecting later test or hook invocations (#16343)[jest-circus, jest-jasmine2]Honor--expandwhen formattingnode:assertfailures, instead of always collapsing the diff (#16347)[jest-circus, jest-jasmine2, jest-message-util]Serialize the inner errors of anAggregateErrorintofailureMessages,retryReasonsandunhandledErrors, so--jsonoutput and reporter annotations include them (#16316)[jest-circus, jest-snapshot]Keep snapshot state and counts correct when a test retries (#16344)[@jest/create-cache-key-function]Include the caller support flags in the generated key, so a transformer that emits ESM or CJS based on them no longer shares one cache entry between the two (#16331)[@jest/create-cache-key-function]Include the stringified project config in the generated key, so editing a transformer's own settings invalidates what it cached (#16331)[@jest/transform]Include the caller support flags in a transform's cache key, so a file transformed both as ESM and as CJS no longer serves one shape's output for the other (#16331)[jest-config]Add missingfindRelatedTests,outputFile, andreplnameentries toValidConfigso they no longer trigger spurious "Unknown option" warnings (#16224)[jest-config]Use--configfor the global config when multiple--projectsare specified (#16273)[jest-core]Serializebigintvalues in--jsonand--outputFileoutput as their literal form (4n), instead of failing the run withTypeError: Do not know how to serialize a BigInt(#16338)[jest-core]Do not report aCustomGCasync resource (used by N-API addons such as napi-rs for per-isolate GC bookkeeping) as an open handle, since it isnapi_unref'd by the addon and can never keep the event loop alive (#16379)[jest-each]Keep a$&,$`,$'or$$inside a%pparam value out of the replacement, so the title shows the value instead of the text around it (#16338)[jest-each]Interpolate abigintinto a%jtitle as its literal form ("4n") at any depth, instead of throwingTypeError: Do not know how to serialize a BigIntwhile collecting the tests (#16338)[jest-environment, jest-runtime]BindsandboxInjectedGlobalsto the right values wheninjectGlobalsisfalse, instead of shifting every one of them by a position (#16377)[jest-environment-node, jest-util]Only warn about a conflictingglobalsCleanupmode when one was explicitly configured, and follow the mode that is actually in effect (#16323)[jest-environment-node, jest-util]Stop resolving lazy globals when setting up an environment, so Node 26's builtin module globals are no longer loaded (and no longer emit their deprecation warnings) for every test file (#16324)[jest-haste-map]Keep watch mode alive when an outside process briefly makes a file unreadable on Windows, instead of tearing the watcher down onEPERM(#16295)[jest-haste-map]Keep indexing when an outside process holds a file open on Windows, instead of failing the whole crawl onEPERM(#16358)[jest-haste-map]Keep a duplicated manual mock resolving when the file it pointed at is deleted in watch mode (#16360)[jest-haste-map]Shut the worker farm down when a duplicate manual mock aborts the build underthrowOnModuleCollision(#16354)[jest-haste-map]Attach the watchman client'serrorlistener before the first command, so a watchman failure falls back to the node crawler instead of crashing on an unhandlederrorevent, and always end the client (#16355)[jest-haste-map]Stop delivering watch events afterWatchmanWatcheris closed, and route its warnings through the configured console (#16355)[jest-haste-map]Restore the nestedduplicatesindex correctly inModuleMap.fromJSON, so a haste collision reported inside a test worker raisesDuplicateHasteCandidatesErrorinstead of aTypeError(#16353)[jest-haste-map]Match watched files on a full extension, somoduleFileExtensions: ['js']no longer acceptsfoo.mjs(#16352)[jest-haste-map]Delimit the fields that make up the haste map cache key, so two different option sets cannot hash to the same cache file (#16352)[jest-message-util]Print the inner errors of anAggregateErrorthrown inside a test (#16316)[jest-message-util]Indent nestedcauseandAggregateErrorsections of a test failure by one level per depth, so the nesting is legible instead of rendering flat (#16316)[jest-message-util]Color stack traces line by line so blank lines stay blank (#16316)[jest-message-util]Detect Jest's own frames without assuming the checkout directory's name, and cover@jest/*packages, so stack traces and code frames point at user code (#16326)[jest-mock]mockResolvedValue/mockRejectedValuenow see all overload return types, so a Promise-returning overload survives even when a later overload returns a non-Promise (e.g.pg.Client['end']) (#16237)[@jest-environment/jsdom-abstract]Make@types/jsdoma peer dependency (#16166)[jest-mock]Remove the leftover own accessor descriptor when restoring aspyOnof an inherited getter or setter, so the instance keeps reflecting the prototype (#16226)[jest-resolve]IncludeextensionsToTreatAsEsmin theshouldLoadAsEsmcache key, so projects with different extension lists don't read each other's answers (#16369)[jest-resolve]MakegetModuleIDAsyncbuild and cachedata:URI module IDs the same way asgetModuleID(#16370)[jest-resolve]Keep thenode:prefix when resolving a core module asynchronously, so a builtin that only exists prefixed (node:sea,node:sqlite,node:test,node:test/reporters) resolves instead of failing as a missing bare package (#16388)[jest-resolve]Look up manual mocks fornode:protocol specifiers under the unprefixed name they are stored as (#16388)[jest-resolve]ApplymoduleNameMapperconsistently to both spellings of core module specifiers (fsvsnode:fs) (#16390)[jest-resolve]Keep virtual and ordinary mock module IDs isolated across test files (#16296)[jest-resolve]Guard missingrequire.resolve.paths(#16052)[jest-resolve, jest-config, jest-runner]Support a user resolver written as an ES module (#16332)[jest-resolve, jest-runtime]Throw the CJS parse error for ESM syntax in a"type": "commonjs"package or a.cjsfile instead of loading it as ESM, matching Node (#16368)[@jest/source-map]Keep source map sources that name a scheme, such aswebpack:///, instead of resolving them into a path that does not exist (#16327)[@jest/source-map]Look up--testLocationInResultspositions at the right column, and keep a mapping to the first column instead of discarding it (#16327)[@jest/source-map]Warn when a source map cannot be parsed, instead of silently leaving its frames untranslated (#16327)[jest-runner, @​jest/source-map]Keep a source-mapped stack for an error thrown after the test environment was torn down (#16327)[jest-runtime, @​jest/source-map]Keep source maps past teardown and past the next test file'sinstall, so a stack from a file no earlier stack mentioned still points at the original source (#16330)[jest-runtime]Report that no coverage was collected whengetAllV8CoverageInfoCopyis called afterteardown, instead of returning an empty result (#16385)[jest-runtime]Cache a CJS module's parsed exports before walking its re-exports, so two modules that re-export each other no longer overflow the stack when imported from ESM (#16363)[jest-runtime]Keep a re-exported ES module's parse failure from marking the re-exporting CommonJS file as ESM, somodule.exports = require('./dep.mjs')loads instead of failing withmodule is not defined(#16363)[jest-runtime]Scope module mocks instantiated insidejest.isolateModules/isolateModulesAsyncto that block, so a mock first imported there no longer outlives it - matching how CommonJS mocks already behave (#16365)[jest-runtime]Suspend module isolation while generating an automock, so loading the real module to read its shape no longer populates the isolated registry (#16365)[jest-runtime]Check a cached ES module's status beforerequire()returns it, so a module whose evaluation threw rethrows that error and one left linked by a failed sibling is evaluated instead of returning uninitialized bindings (#16364)[jest-runtime]Report the originalERR_REQUIRE_ASYNC_MODULEwhen arequire()of a top-level-await graph is retried, instead of a spurious "concurrentimport()" error (#16364)[jest-runtime]Throw the evaluation error when another caller'simport()of the same module failed while we awaited it, instead of resolving with the errored module (#16364)[jest-runtime]Mark the result ofrequire()ing an ES module that has a default export with__esModule: truethrough a live-binding facade, and serve the same object fromrequire.cache, matching Node (#16367)[jest-runtime]Provide a CommonJS module's exports under the'module.exports'named export when imported from ESM, matching Node 23+ (#16367)[jest-runtime]Give the test file itself a non-nullrequire.main(#16367)[jest-runtime]Populatemodule.childrenwith the modules a file loads, matching Node (#16368)[jest-runtime]Provideimport.meta.resolveandimport.meta.jestindata:URI modules, accept any-case mediatype parameters, and use Node's error codes for invaliddata:URIs (#16368)[jest-runtime]Key ES modules by full URL, so query and fragment suffixes create the same module instances as Node and show up inimport.meta.url(#16375)[jest-runtime]Share modules between overlapping graphs when a CommonJS modulerequire()s an ES module mid-load, instead of evaluating shared dependencies twice (#16375)[jest-runtime]ThrowERR_REQUIRE_CYCLE_MODULElike Node when a CommonJS modulerequire()s an ES module that is still being loaded, instead of evaluating the module a second time (#16366)[jest-runtime]Key builtin modules in the ESM registry by one canonical specifier (#16341)[jest-runtime]import.meta.resolve()for a builtin uses itsnode:specifier (#16341)[jest-runtime]Fall back to native ESM when a.jsfile contains ESM syntax but has no"type":"module"marker (#16152)[jest-runtime]Allowrequire()of ESM-marked files on Node < 24.9 via transform fallback (#16244)[jest-runtime, @​jest/transform]Surface actionableERR_REQUIRE_ESMerror for files with untransformed ESM syntax instead of the generic "unexpected token" message (#16244)[jest-runtime]Support older test environments whosemoduleMockerdoes not implementclearMocksOnScope(#16169)[jest-runtime]Applyjest.unstable_mockModulewhen the mocked file itself isrequire()d, not only when it is imported as a dependency (#16389)[jest-runtime]Applyjest.unstable_mockModuleto statically importeddata:URIs on Node 24.9+, matching dynamicimport()(#16389)[jest-runtime]Run an asyncjest.unstable_mockModulefactory once per module instead of twice, and fail the import instead of crashing the worker when the factory rejects (#16389)[jest-runtime]Hide arequire(esm)module that failed to evaluate fromrequire.cache, as Node does, instead of exposing a namespace with uninitialized bindings (#16389)[jest-runtime]Strip the byte-order mark when importing a JSON module, matchingrequire()and Node (#16389)[jest-runtime]ThrowERR_REQUIRE_ASYNC_MODULEwhenrequire(esm)runs under an async-only custom resolver, instead of silently resolving with the default resolver (#16389)[jest-runtime]Parse imported JSON modules with the test realm'sJSON, so their objects passinstanceof Objectinside the test likerequire()d JSON does (#16389)[jest-runtime]Accept everyfile:URL string in the sandboxedmodule.createRequire, including one with alocalhostauthority, as Node does (#16389)[jest-runtime]Point at{virtual: true}whenjest.mockorjest.unstable_mockModuleis given a module that cannot be resolved (#16389)[jest-reporters]Fix coverage report table formatting in CI/GitHub Actions environments whereprocess.stdout.columnsis undefined by falling back to theCOLUMNSenv var or80columns in CI, preserving existing behaviour in other non-TTY environments (#16227)[jest-runtime]Support CJS-in-ESM exports via"module.exports"named exports (#16277)[jest-snapshot]Keep a skipped or failed test's hinted snapshots, instead of reporting them obsolete (#16348)[jest-util]StopglobsToMatcherreusing a cached matcher compiled with different picomatch options, and keep itsdot: truedefault whendotis passed asundefined(#16381)[pretty-format]Move thereact-isaliases into the@jestscope, so they cannot be shadowed by unrelated packages published under the alias names (#16333)Chore & Maintenance
[docs]Document the intentional divergences from Node's module system in the ECMAScript Modules page (#16368)[docs]Note deprecation ofreact-test-rendererin React Native tutorial andpretty-formatREADME (#16294)[docs]Use@testing-library/react-nativein the React Native tutorial instead of the deprecatedreact-test-renderer(#16318)[babel-jest, @​jest/transform]Updatebabel-plugin-istanbulto v8 (#16049)[jest-config, @​jest/reporters, jest-runtime]Updateglobto v13 (#16397)[jest-haste-map]Refactor massive class into multiple files (#16180)[jest-haste-map]Dropwalkerdependency; replace hand-rolled directory recursion in the JS crawler and watcher startup withfdir(#16187)[jest-haste-map]Reuse cached metadata for files whose haste name is a known duplicate, instead of re-reading and re-parsing them on every startup (#16351)[jest-haste-map]Cache the watchman socket path and replace thewatchman --versionprobe withget-sockname, so warm runs spawn no watchman processes (#16386)[jest-resolve]Store the per-directory package-type lookup in the cache it reads, so it actually memoizes (#16369)[jest-resolve, jest-runtime]Cut repeated work on the resolution hot path: hoist the platform-extension list to construction, memoizeisCoreModuleand the options cache-key serialization, skip mapper preparation when nomoduleNameMapperis configured, run each mapper regex once, and stop re-parsingNODE_OPTIONSon every default-resolver call (#16371)[jest-resolve]Cut warm resolution cost to about a third: reuse oneunrs-resolverfactory per options shape instead of cloning per resolution, compose the factory cache key from per-array cached strings instead of serializing options, and stop constructing anErrorfor misses thatfindNodeModuleswallows; add a__benchmarks__suite for the default resolver (#16373)[jest-runner, @​jest/source-map]Replacesource-map-supportwith an implementation in@jest/source-map(#16327)[jest-snapshot]Load babel, semver and synckit lazily, so requiring the package (which every test process does through@jest/expect) no longer loads ~200 modules that only writing inline snapshots needs (#16387)[jest-runtime]Reduce per-require overhead: skip module ID resolution when no mock can apply, answer core modules before probing for a manual mock, share onerequire.cacheproxy across modules, and cache empty files (#16376)[@jest/source-map]DeprecategetCallsitein favour ofSourceMapSupport#getCallsite(#16327)[jest-runtime]Avoid magicalnullvalue in ESM loader (#16160)v30.4.2Compare Source
Fixes
[jest-runtime]Fix named imports from CJS modules whosemodule.exportsis a function with own-property exports (#16150)v30.4.1Compare Source
Features
[jest-config, jest-core, jest-runner, jest-schemas, jest-types]Allow custom runner configuration options via tuple format['runner-path', {options}](#16141)Fixes
[jest-runtime]Align CJS-from-ESM default export with Node:module.exportsis always the ESM default,__esModuleunwrapping is no longer applied (#16143)v30.4.0Compare Source
Features
[babel-jest]Support collecting coverage from.mts,.cts(and other) files (#15994)[jest-circus, jest-cli, jest-config, jest-core, jest-jasmine2, jest-types]Add--collect-testsflag to discover and list tests without executing them (#16006)[jest-config, jest-runner, jest-worker]AddworkerGracefulExitTimeoutconfig option to control how long workers are given to exit before being force-killed (#15984)[jest-config]Add support forjest.config.mtsas a valid configuration file (#16005)[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 (#16133)[@jest/fake-timers]AcceptTemporal.Durationinjest.advanceTimersByTime()andjest.advanceTimersByTimeAsync()(#16128)[@jest/fake-timers]AcceptTemporal.InstantandTemporal.ZonedDateTimeinjest.setSystemTime()anduseFakeTimers({now})(#16128)[@jest/fake-timers]Support fakingTemporal.Now.*(#16131)[jest-mock]AddclearMocksOnScope(scope)onModuleMockerfor clearing every mock function exposed on a scope object (#16088)[jest-resolve]AddcanResolveSync()onResolverso callers can detect when a user-configured resolver only exports anasynchook (#16064)[jest-runtime]Use synchronousevaluate()for ES modules without top-levelawaiton Node versions that support it (v24.9+), and prefer the synchronous transform path when a sync transformer is configured (#16062)[jest-runtime]Supportrequire()of ES modules on Node v24.9+ (#16074)[jest-runtime]Validate TC39 import attributes (with { type: 'json' }) on ESM imports (#16127)[@jest/transform]AddcanTransformSync(filename)onScriptTransformerso callers can pick the sync vs async transform path (#16062)[jest-util]AddisErrorhelper (#16076)[pretty-format]Support React 19 (#16123)Fixes
[expect-utils]FixtoStrictEqualfailing onstructuredCloneresults due to cross-realm constructor mismatch (#15959)[@jest/expect-utils]PreventtoMatchObject/subset matching from throwing when encountering exotic iterables (#15952)[fake-timers]ConvertDateto milliseconds before passing to@sinonjs/fake-timers(#16029)[jest]ExportGlobalConfigandProjectConfigTypeScript types (#16132)[jest-circus]Prevent crash whenasyncErroris undefined for non-Error throws (#16003)[jest-circus, jest-jasmine2]IncludeError.causein JSONfailureMessagesoutput (#15967)[jest-config]Fix preset path resolution on Windows when the preset uses subpathexports(#15961)[jest-config]AllowcollectCoverageandcoverageProviderin project config without a validation warning (#16132)[jest-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 (#16132)[jest-environment-node]Fix--localstorage-filewarning on Node 25+ (#16086)[jest-reporters]Apply global coverage threshold to unmatched pattern files in addition to glob/path thresholds (#16137)[jest-reporters, jest-runner, jest-runtime, jest-transform]Fix coverage report not showing correct code coverage when usingprojectsconfig option (#16140)[jest-runtime]Resolveexpectand@jest/expectfrom the internal module registry so test-file imports share the sameJestAssertionErroras the globalexpect(#16130)[jest-runtime]Improve CJS-from-ESM interop:__esModule/Babel default unwrap, broader named-export coverage, and shared CJS singleton across importers (#16050)[jest-runtime]Load.jsfiles with ESM syntax but no"type":"module"marker as native ESM (#16050)[jest-runtime]Extend the.js-with-ESM-syntax fallback torequire()on Node v24.9+ - falls back torequire(esm)when the CJS parser rejects ESM syntax (#16078)[jest-runtime]Fix deadlocks and double-evaluation in concurrent ESM and wasm imports (#16050)[jest-runtime]Fix error whenrequire()is called after the Jest environment has been torn down (#15951)[jest-runtime]Fix missing error whenimport()is called after the Jest environment has been torn down (#16080)[jest-runtime]Fix virtualunstable_mockModuleregistrations not respected in ESM (#16081)[jest-runtime]ApplymoduleNameMapperwhen resolving modules withrequire.resolve()and thepathsoption (#16135)Chore & Maintenance
[@jest/fake-timers]Upgrade@sinonjs/fake-timers(#16139)[jest-runtime]Use synchronouslinkRequests/instantiatefor ESM linking on Node v24.9+ (#16063)v30.3.0Compare Source
Features
[jest-config]AdddefineConfigandmergeConfighelpers for type-safe Jest config (#15844)[jest-fake-timers]AddsetTimerTickModeto configure how timers advance[*]Reduce token usage when run through LLMs (3f17932)Fixes
[jest-config]Keep CLI coverage output when using--jsonwith--outputFile(#15918)[jest-mock]UseSymbolfrom test environment (#15858)[jest-reporters]Fix issue where console output not displayed for GHA reporter even withsilent: falseoption (#15864)[jest-runtime]Fix issue where user cannot utilize dynamic import despite specifying--experimental-vm-modulesNode option (#15842)[jest-test-sequencer]Fix issue where failed tests due to compilation errors not getting re-executed even with--onlyFailuresCLI option (#15851)[jest-util]Make sureprocess.features.require_moduleisfalse(#15867)Chore & Maintenance
[*]Replace remaining micromatch uses with picomatch[deps]Update to sinon/fake-timers v15[docs]Update V30 migration guide to notify users onjest.mock()work with case-sensitive path (#15849)v30.2.0Compare Source
Chore & Maintenance
[*]Update example repo for testing React Native projects (#15832)[*]Updatejest-watch-typeaheadto v3 (#15830)v30.1.3Compare Source
Fixes
unstable_mockModulewithnode:prefixed core modules.v30.1.2Compare Source
Fixes
[jest-snapshot-utils]Correct snapshot header regexp to work with newline across OSes (#15803)v30.1.1Compare Source
Fixes
[jest-snapshot-utils]Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)[jest-snapshot-utils]Improve messaging about goo.gl snapshot link change (#15821)v30.1.0Compare Source
v30.0.5Compare Source
Features
[jest-config]AllowtestMatchto take a string value[jest-worker]LetworkerIdleMemoryLimitaccept 0 to always restart worker child processesFixes
[expect]Fixbiginterror (#15702)v30.0.4Compare Source
Features
[expect]TheInversetype is now exported (#15714)[expect]feat: supportasync functionsintoBe(#15704)Fixes
[jest]jest --onlyFailures --listTests now correctly lists only failed tests (#15700)[jest-snapshot]Handle line endings in snapshots (#15708)v30.0.3Compare Source
Fixes
[jest-config]Fix ESM TS config loading in a CJS project (#15694)[jest-core]jest --onlyFailures --listTests now correctly lists only failed tests(#15700)Features
[jest-diff]Show non-printable control characters to diffs (#15696)v30.0.2Compare Source
Fixes
[jest-matcher-utils]Make 'deepCyclicCopyObject' safer by setting descriptors to a null-prototype object (#15689)[jest-util]Make garbage collection protection property writable (#15689)v30.0.1Compare Source
Features
[jest-resolver]Implement thedefaultAsyncResolver(#15679)Fixes
[jest-resolver]Resolve builtin modules correctly (#15683)[jest-environment-node, jest-util]Avoid setting globals cleanup protection symbol when feature is off (#15684)Chore & Maintenance
[*]Remove and deprecatejest-replpackage (#15673)[jest-resolver]Replace customisBuiltinModulewith node'sisBuiltin(#15685)v30.0.0Compare Source
Features
[*]RenamedglobalsCleanupModetoglobalsCleanupand--waitNextEventLoopTurnForUnhandledRejectionEventsto--waitForUnhandledRejections[expect]AddArrayOfasymmetric matcher for validating array elements. (#15567)[babel-jest]Add optionexcludeJestPresetto allow opting out ofbabel-preset-jest(#15164)[expect]Revert #15038 to fixexpect(fn).toHaveBeenCalledWith(expect.objectContaining(...))when there are multiple calls (#15508)[jest-circus, jest-cli, jest-config]AddwaitNextEventLoopTurnForUnhandledRejectionEventsflag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)[jest-circus]Add awaitBeforeRetryoption tojest.retryTimes(#14738)[jest-circus]Add aretryImmediatelyoption tojest.retryTimes(#14696)[jest-circus, jest-jasmine2]AllowsetupFilesAfterEnvto export an async function (#14749)[jest-circus, jest-test-result]AddstartedAttimestamp inTestCaseResultObjectwithinonTestCaseResult(#15145)[jest-cli]ExportbuildArgv(#15310)[jest-config][BREAKING] Addmtsandctsto defaultmoduleFileExtensionsconfig (#14369)[jest-config][BREAKING] UpdatetestMatchandtestRegexdefault option for supportingmjs,cjs,mts, andcts(#14584)[jest-config]Loads config file from provided path inpackage.json(#14044)[jest-config]Allow loadingjest.config.ctsfiles (#14070)[jest-config]ShowrootDirin error message when apresetfails to load (#15194)[jest-config]Support loading TS config files usingesbuild-registervia docblock loader (#15190)[jest-config]Allow passing TS config loader options via docblock comment (#15234)[jest-config]If Node is running with type stripping enabled, do not require a TS loader (#15480)[@jest/core]Group together open handles with the same stack trace (#13417, & #14789)[@jest/core]AddperfStatsto surface test setup overhead (#14622)[@jest/core][BREAKING] Changed--filterto accept an object with shape{ filtered: Array<string> }to match documentation (#13319)[@jest/core]Support--outputFileoption for--listTests(#14980)[@jest/core]Stringify Errors properly with--jsonflag (#15329)[@jest/core, @​jest/test-sequencer][BREAKING] ExposesglobalConfig&contextstoTestSequencer(#14535, & #14543)[jest-each]Introduce%$option to add number of the test to its title (#14710)[@jest/environment][BREAKING] Remove deprecatedjest.genMockFromModule()(#15042)[@jest/environment][BREAKING] Remove unnecessary defensive code (#15045)[jest-environment-jsdom][BREAKING] Upgrade JSDOM to v22 (#13825)[@jest/environment-jsdom-abstract]Introduce new package which abstracts over thejsdomenvironment, allowing usage of custom versions of JSDOM (#14717)[jest-environment-node]Update jest environment with dispose symbolsSymbol(#14888 & #14909)[expect, @​jest/expect][BREAKING] Add type inference for function parameters inCalledWithassertions (#15129)[@jest/expect-utils]Properly compare all types ofTypedArrays (#15178)[@jest/fake-timers][BREAKING] Upgrade@sinonjs/fake-timersto v13 (#14544 & #15470)[@jest/fake-timers]Exposing new modern timers functionadvanceTimersToFrame()which advances all timers by the needed milliseconds to execute callbacks currently scheduled withrequestAnimationFrame(#14598)[jest-matcher-utils]AddSERIALIZABLE_PROPERTIESto allow custom serialization of objects (#14893)[jest-mock]Add support for the Explicit Resource Management proposal to use theusingkeyword withjest.spyOn(object, methodName)(#14895)[jest-reporters]Add support for DEC mode 2026 (#15008)[jest-resolver]Supportfile://URLs as paths (#15154)[jest-resolve,jest-runtime,jest-resolve-dependencies]Pass the conditions when resolving stub modules (#15489)[jest-runtime]Exposing new modern timers functionjest.advanceTimersToFrame()from@jest/fake-timers(#14598)[jest-runtime]Supportimport.meta.filenameandimport.meta.dirname(available from Node 20.11) (#14854)[jest-runtime]Supportimport.meta.resolve(#14930)[jest-runtime][BREAKING] Make it mandatory to passglobalConfigto theRuntimeconstructor (#15044)[jest-runtime]Addunstable_unmockModule(#15080)[jest-runtime]AddonGenerateMocktransformer callback for auto generated callbacks (#15433 & #15482)[jest-runtime][BREAKING] Usevm.compileFunctionovervm.Script(#15461)[@jest/schemas]Upgrade@sinclair/typeboxto v0.34 (#15450)[@jest/types]test.each(): Accept a readonly (as const) table properly (#14565)[@jest/types]Improve argument type inference passed totestanddescribecallback functions fromeachtables (#14920)[jest-snapshot][BREAKING] Add support for Error causes in snapshots (#13965)[jest-snapshot]Support Prettier 3 (#14566)[@jest/util-snapshot]Extract utils used by tooling fromjest-snapshotinto its own package (#15095)[pretty-format][BREAKING] Do not render empty string children ('') in React plugin (#14470)Fixes
[expect]ShowAggregateErrorto display (#15346)[*]Replaceexitwithexit-x(#15399)[babel-plugin-jest-hoist]Usedenylistinstead of the deprecatedblacklistfor Babel 8 support (#14109)[babel-plugin-jest-hoist]Do not rely on buggy Babel behaviour (#15415)[expect]Check error instance type fortoThrow/toThrowError(#14576)[expect]Improve diff for failingexpect.objectContaining(#15038)[expect]UseArray.isArrayto check if an array is anArray(#15101)[expect]Fix Errorcauseassertion errors (#15339)[jest-changed-files]Print underlying errors when VCS commands fail (#15052)[jest-changed-files]Abortsl rootcall if output resembles a steam locomotive (#15053)[jest-circus][BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)[jest-circus]Replace recursivemakeTestResultsimplementation with iterative one (#14760)[jest-circus]Omitexpect.hasAssertions()errors if a test already has errors (#14866)[jest-circus, jest-expect, jest-snapshot]Passtest.failingtests when containing failing snapshot matchers (#14313)[jest-circus]Concurrent tests now emit jest circus events at the correct point and in the expected order. (#15381)[jest-cli][BREAKING] Validate CLI flags that require arguments receives them (#14783)[jest-config]Make sure to respectrunInBandoption (#14578)[jest-config]SupporttestTimeoutin project config (#14697)[jest-config]SupportcoverageReportersin project config (#14830)[jest-config]Allowreportersin project config (#14768)[jest-config]Allow Node16/NodeNext/BundlermoduleResolutionin project's tsconfig (#14739)[@jest/create-cache-key-function]Correct the return type ofcreateCacheKey(#15159)[jest-each]Allow$keypathtemplates withnullorundefinedvalues (#14831)[@jest/expect-utils]Fix comparison ofDataView(#14408)[@jest/expect-utils][BREAKING] exclude non-enumerable in object matching (#14670)[@jest/expect-utils]Fix comparison ofURL(#14672)[@jest/expect-utils]CheckSymbolproperties in equality (#14688)[@jest/expect-utils]Catch circular references within arrays when matching objects (#14894)[@jest/expect-utils]Fix not addressing to Sets and Maps as objects without keys (#14873)[jest-haste-map]Fix errors or clobbering with multiplehasteImplModulePaths (#15522)[jest-leak-detector]Make leak-detector more aggressive when running GC (#14526)[jest-runtime]Properly handle re-exported native modules in ESM via CJS (#14589)[jest-runtime]Refactor_importCoreModelso required core module is consistent if modified while loading (#15517)[jest-schemas, jest-types][BREAKING] Fix type oftestFailureExitCodeconfig option(#15232)[jest-util]Make sureisInteractiveworks in a browser (#14552)[pretty-format][BREAKING] PrintArrayBufferandDataViewcorrectly (#14290)[pretty-format]Fixed a bug where "anonymous custom elements" were not being printed as expected. (#15138)[jest-cli]When specifying paths on the command line, only match against the relative paths of the test files (#12519)testPathPatternconfiguration option totestPathPatterns, which now takes a list of patterns instead of the regex.--testPathPatternis now--testPathPatternstestPathPatternswhen 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 (#14619)[jest-util]Always loadmjsfiles withimport(#15447)[jest-worker]Properly handle a circular reference error when worker tries to send an assertion fails where either the expected or actual value is circular (#15191)[jest-worker]Properly handle a BigInt when worker tries to send an assertion fails where either the expected or actual value is BigInt (#15191)[expect]Resolve issue whereObjectContainingmatched non-object values. #15463.conditional/checkto ensure the argument passed toexpectis an object.ObjectContainingbehavior.invalid/wrongtest case assertions forObjectContaining.[jest-worker]Addresses incorrect state on exit (#15610)Performance
[*][BREAKING] Bundle all of Jest's modules intoindex.js(#12348, #14550 & #14661)[jest-haste-map]Only spawn one process to check forwatchmaninstallation (#14826)[jest-runner]Better cleanupsource-map-supportafter test to resolve (minor) memory leak (#15233)[jest-resolver]Migrateresolveandresolve.exportstounrs-resolver(#15619)[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
[jest-environment-jsdom, jest-environment-jsdom-abstract]Increased version of jsdom to^26.0.0(#15473)[*]Increase version ofmicromatchto^4.0.7(#15082)[*][BREAKING] Drop support for Node.js versions 14, 16, 19, 21 and 23 (#14460, #15118, #15623, #15640)[*][BREAKING] Drop support fortypescript@4.3, minimum version is now5.4(#14542, #15621)[*]Depend on exact versions of monorepo dependencies instead of^range (#14553)[*][BREAKING] Add ESM wrapper for all of Jest's modules (#14661)[*][BREAKING] Upgrade toglob@10(#14509)[*]UseTypeErroroverErrorwhere appropriate (#14799)[docs]Fix typos inCHANGELOG.mdandpackages/jest-validate/README.md(#14640)[docs]Don't use alias matchers in docs (#14631)[babel-jest, babel-preset-jest][BREAKING] Increase peer dependency of@babel/coreto^7.11(#14109)[babel-jest, @​jest/transform]Updatebabel-plugin-istanbulto v6 (#15156)[babel-plugin-jest-hoist]Move unnecessarydependenciestodevDependencies(#15010)[expect][BREAKING] Remove.toBeCalled(),.toBeCalledTimes(),.toBeCalledWith(),.lastCalledWith(),.nthCalledWith(),.toReturn(),.toReturnTimes(),.toReturnWith(),.lastReturnedWith(),.nthReturnedWith()and.toThrowError()matcher aliases (#14632)[jest-cli, jest-config, @​jest/types][BREAKING] Remove deprecated--initargument (#14490)[jest-config, @​jest/core, jest-util]Upgradeci-info(#14655)[jest-mock][BREAKING] RemoveMockFunctionMetadataType,MockFunctionMetadataandSpyInstancetypes (#14621)[@jest/reporters]Upgradeistanbul-lib-source-maps(#14924)[jest-schemas]Upgrade@sinclair/typebox(#14775)[jest-transform]Upgradewrite-file-atomic(#14274)[jest-util]Upgradepicomatchto v4 (#14653 & #14885)[docs] Append to NODE_OPTIONS, not overwrite ([#​14730](https://github.com/jestjs/jest/pull/14730))[docs]Updated.toHaveBeenCalled()documentation to correctly reflect its functionality (#14842)[docs]Link NestJS documentation on testing with Jest (#14940)[docs]Revised documentation for .toHaveBeenCalled()to accurately depict its functionality. (#14853)[docs]Removed ExpressJS reference link from documentation due to dead link (#15270)[docs]Correct broken links in docs (#15359)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Renovate Bot.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: yarn.lock
1513002e9fc7415a7e8cchore(deps): update dependency jest to v30to chore(deps): update jest monorepo to v30 (major)c7415a7e8c4cd18f7f234cd18f7f2340f8734a4a40f8734a4a82a3f79f5182a3f79f51b1739ab36cView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.