🚨 [security] Update all of jest 29.7.0 → 30.2.0 (major)


🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ @​jest/globals (29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

✳️ babel-jest (29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

✳️ jest (29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/console (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/core (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/environment (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/fake-timers (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/reporters (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/schemas (indirect, 29.6.3 → 30.0.5) · Repo · Changelog

Release Notes

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/source-map (indirect, 29.6.3 → 30.0.1) · Repo · Changelog

Release Notes

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/test-sequencer (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/transform (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​jest/types (indirect, 29.6.3 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​sinclair/typebox (indirect, 0.27.8 → 0.34.41) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 1 commit:

↗️ @​sinonjs/fake-timers (indirect, 10.3.0 → 13.0.5) · Repo · Changelog

Release Notes

13.0.5 (from changelog)

  • Ensure checks based Object.keys length pass for fake Dates (#513)

13.0.4 (from changelog)

  • Fix constructor-based checks for fake Date no longer pass after installing (#512) (patches the patch)

13.0.3 (from changelog)

  • Ensure checks based on the constructor property passes for fake Dates (#511)

13.0.2 (from changelog)

  • fix #504: make instances of original Date pass as instances of the fake Date (#505)

13.0.1 (from changelog)

  • Add a guard to prevent test from failing in Puppeteer
  • Add a missing test on using timers not present on a custom global
  • Fix toString() output

13.0.0 (from changelog)

  • fix: fake all supported timers by default (#323) (BREAKING)

12.0.0 (from changelog)

  • Support performance.measure+mark (#499)
  • fix: save methods of children Date instance (#437) (#480) (potentially BREAKING)

11.3.1 (from changelog)

  • Prevent releasing on branches other than 'main'
  • Enable saucelabs tests
  • chore: security audit fix
  • Remove Husky deprecation messsage that came in v9

11.2.2 (from changelog)

11.2.1 (from changelog)

  • no-op to fix a broken release process

11.1.0 (from changelog)

  • favor the constructor of the performance instance if it exists (#478)
  • Bump tough-cookie from 4.1.2 to 4.1.3 (#473)
  • Remove IE specific hacks (#477)
  • feat: mock intl api (#474)
  • upgrade node (#476) and EOL Node 14
  • Bump word-wrap from 1.2.3 to 1.2.4 (#475)
  • Updated release files for 11.0.0
  • Updated release files for 10.2.0
  • Add mocks to NodeJS "timers" module (#467)

11.0.0 (from changelog)

  • Re-release 10.2.0 as a new major version as mocking Node "timers" module broke some setups

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​types/babel__generator (indirect, 7.6.8 → 7.27.0) · Repo

Sorry, we couldn’t find anything useful about this release.

↗️ @​types/babel__traverse (indirect, 7.20.6 → 7.28.0) · Repo

Sorry, we couldn’t find anything useful about this release.

↗️ ansi-regex (indirect, 5.0.1 → 6.2.2) · Repo

Security Advisories 🚨

🚨 Inefficient Regular Expression Complexity in chalk/ansi-regex

ansi-regex is vulnerable to Inefficient Regular Expression Complexity which could lead to a denial of service when parsing invalid ANSI escape codes.

Proof of Concept

import ansiRegex from 'ansi-regex';
for(var i = 1; i <= 50000; i++) {
    var time = Date.now();
    var attack_str = "\u001B["+";".repeat(i*10000);
    ansiRegex().test(attack_str)
    var time_cost = Date.now() - time;
    console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}

The ReDOS is mainly due to the sub-patterns [[\\]()#;?]* and (?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*

Release Notes

6.2.2

6.2.0

  • Support colon separated parameters to control sequences (#62) df7d75f

v6.1.0...v6.2.0

6.1.0

  • Match cursorSave and cursorRestore escape codes (#45) 02fa893
  • Fix: Handle all valid ST characters (#58) 9cba40d

v6.0.1...v6.1.0

6.0.1

Fixes

  • Fix ReDoS in certain cases (#37)
    You are only really affected if you run the regex on untrusted user input in a server context, which it's very unlikely anyone is doing, since this regex is mainly used in command-line tools.

v6.0.0...v6.0.1

Thank you @yetingli for the patch and reproduction case!

6.0.0

Breaking

v5.0.0...v6.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 63 commits:

↗️ babel-plugin-istanbul (indirect, 6.1.1 → 7.0.1) · Repo · Changelog

Release Notes

7.0.1

Bug Fixes

7.0.0

⚠ BREAKING CHANGES

  • Drop support for Node versions 8 and 10

Bug Fixes

  • container is falsy error with block scoping transform (#291) (8e76919)
  • update istanbul-lib-instrument to v6 (#292) (643e080)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 7 commits:

↗️ babel-plugin-jest-hoist (indirect, 29.6.3 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ babel-preset-current-node-syntax (indirect, 1.1.0 → 1.2.0) · Repo

Commits

See the full diff on Github. The new version differs by 6 commits:

↗️ babel-preset-jest (indirect, 29.6.3 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ ci-info (indirect, 3.9.0 → 4.3.1) · Repo · Changelog

Release Notes

4.3.1

Bug Fixes

  • don't read envs when CI is set to false 3fae1ac

4.3.0

  • support Cloudflare workers e438266

4.2.0

What's Changed

New Contributors

Full Changelog: v4.1.0...v4.2.0

4.1.0

What's Changed

New Contributors

Full Changelog: v4.0.0...v4.1.0

4.0.0

Breaking Changes

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 40 commits:

↗️ cjs-module-lexer (indirect, 1.3.1 → 2.1.0) · Repo · Changelog

Release Notes

2.1.0

What's Changed

  • Add instructions for creating a release to the readme. by @mhdawson in #109
  • fix: restore configuration through env variables by @mhdawson in #111

Full Changelog: 2.0.0...2.1.0

2.0.0

What's Changed

New Contributors

Full Changelog: 1.4.1...2.0.0

1.4.2

What's Changed

New Contributors

Full Changelog: 1.4.1...1.4.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 19 commits:

↗️ collect-v8-coverage (indirect, 1.0.2 → 1.0.3) · Repo · Changelog

Release Notes

1.0.3

1.0.3 (2025-10-15)

Bug Fixes

  • enable and disable debugger for more accurate coverage (#235) (44fdef5)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ dedent (indirect, 1.5.3 → 1.7.0) · Repo · Changelog

Release Notes

1.7.0

What's Changed

New Contributors

Full Changelog: v1.6.0...v1.7.0

1.6.0

What's Changed

  • feat: add trimWhitespace option by @43081j in #97

New Contributors

Full Changelog: v1.5.3...v1.6.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 5 commits:

↗️ emoji-regex (indirect, 8.0.0 → 9.2.2) · Repo

Commits

See the full diff on Github. The new version differs by 24 commits:

↗️ error-ex (indirect, 1.3.2 → 1.3.4) · Repo

Security Advisories 🚨

🚨 error-ex@1.3.3 contains malware after npm account takeover

Impact

On 8 September 2025, an npm publishing account for error-ex was taken over after a phishing attack. Version 1.3.3 was published, functionally identical to the previous patch version, but with a malware payload added attempting to redirect cryptocurrency transactions to the attacker's own addresses from within browser environments.

Local environments, server environments, command line applications, etc. are not affected. If the package was used in a browser context (e.g. a direct <script> inclusion, or via a bundling tool such as Babel, Rollup, Vite, Next.js, etc.) there is a chance the malware still exists and such bundles will need to be rebuilt.

The malware seemingly only targets cryptocurrency transactions and wallets such as MetaMask. See references below for more information on the payload.

Patches

npm removed the offending package from the registry over the course of the day on 8 September, preventing further downloads from npm proper.

On 13 September, the package owner published new patch versions to help cache-bust those using private registries who might still have the compromised version cached. This version is functionally identical to the previously known-good version, published as a patch version bump above the compromised version.

Users should update to the latest patch version, completely remove their node_modules directory, clean their package manager's global cache, and rebuild any browser bundles from scratch.

Those operating private registries or registry mirrors should purge the offending versions from any caches.

References

Point of Contact

In the event suspicious behavior is still observed for the package listed in this security advisory after performing all of the above cleaning operations (see Patches above), please reach out via one of the following channels of communication:

Release Notes

1.3.4

Functionally identical release to 1.3.2.

Version 1.3.3 is compromised. Please see debug-js/debug#1005.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 3 commits:

↗️ expect (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ glob (indirect, 7.2.3 → 10.4.5) · Repo · Changelog

Release Notes

10.3.0 (from changelog)

  • Add --default -p flag to provide a default pattern

10.2.0 (from changelog)

  • Add glob cli

10.1.0 (from changelog)

  • Return '.' instead of the empty string '' when the current working directory is returned as a match.
  • Add posix: true option to return / delimited paths, even on Windows.

10.0.0 (from changelog)

  • No default exports, only named exports

9.3.3 (from changelog)

  • Upgraded minimatch to v8, adding support for any degree of nested extglob patterns.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ istanbul-lib-source-maps (indirect, 4.0.1 → 5.0.6) · Repo · Changelog

Release Notes

5.0.6 (from changelog)

Bug Fixes

  • istanbul-lib-source-maps implicit else crash edge case (#789) (bbb5815)

5.0.5 (from changelog)

Bug Fixes

  • istanbul-lib-source-maps to preserve implicit else when sourcemaps are used (#706) (d16a155)

Does any of this look wrong? Please let us know.

↗️ istanbul-reports (indirect, 3.1.7 → 3.2.0) · Repo · Changelog

Release Notes

3.2.0 (from changelog)

Features

  • update HTML report filter to take a RegEx (#796) (a739999)

Bug Fixes

Does any of this look wrong? Please let us know.

↗️ jest-changed-files (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-circus (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-cli (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-config (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-diff (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-docblock (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-each (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-environment-node (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-haste-map (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-leak-detector (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-matcher-utils (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-message-util (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-mock (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-regex-util (indirect, 29.6.3 → 30.0.1) · Repo · Changelog

Release Notes

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-resolve (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-resolve-dependencies (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-runner (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-runtime (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-snapshot (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.3 (from changelog)

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)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-util (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-validate (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-watcher (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.3

Fixes

  • Fix unstable_mockModule with node: prefixed core modules.

30.1.2 (from changelog)

Fixes

  • [jest-snapshot-utils] Correct snapshot header regexp to work with newline across OSes (#15803)

30.1.1

Fixes

  • [jest-snapshot-utils] Fix deprecated goo.gl snapshot warning not handling Windows end-of-line sequences (#15800)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.4 (from changelog)

Features

  • [expect] The Inverse type is now exported (#15714)
  • [expect] feat: support async functions in toBe (#15704)

Fixes

  • [jest] jest --onlyFailures --listTests now correctly lists only failed tests (#15700)
  • [jest-snapshot] Handle line endings in snapshots (#15708)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ jest-worker (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.1.0

Features

  • [jest-leak-detector] Configurable GC aggressiveness regarding to V8 heap snapshot generation (#15793)
  • [jest-runtime] Reduce redundant ReferenceError messages
  • [jest-core] Include test modules that failed to load when --onlyFailures is active

Fixes

  • `[jest-snapshot-utils] Fix deprecated goo.gl snapshot guide link not getting replaced with fully canonical URL (#15787)
  • [jest-circus] Fix it.concurrent not working with describe.skip (#15765)
  • [jest-snapshot] Fix mangled inline snapshot updates when used with Prettier 3 and CRLF line endings
  • [jest-runtime] Importing from @jest/globals in more than one file no longer breaks relative paths (#15772)

Chore

  • [expect] Update docblock for toContain() to display info on substring check (#15789)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ pirates (indirect, 4.0.6 → 4.0.7) · Repo

Release Notes

4.0.7

4.0.7 (2025-03-27)

Bug Fixes

  • remove build process and ship source directly (924ccc3)
  • Update some wording and fix grammar in messages (#121) (f39d729)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 12 commits:

↗️ pretty-format (indirect, 29.7.0 → 30.2.0) · Repo · Changelog

Release Notes

30.2.0

Chore & Maintenance

  • [*] Update example repo for testing React Native projects (#15832)
  • [*] Update jest-watch-typeahead to v3 (#15830)

Features

  • [jest-environment-jsdom-abstract] Add support for JSDOM v27 (#15834)

Fixes

  • [babel-jest] Export the TransformerConfig interface (#15820)
  • [jest-config] Fix jest.config.ts with TS loader specified in docblock pragma (#15839)

30.0.5 (from changelog)

Features

  • [jest-config] Allow testMatch to take a string value
  • [jest-worker] Let workerIdleMemoryLimit accept 0 to always restart worker child processes

Fixes

  • [expect] Fix bigint error (#15702)

30.0.2

What's Changed

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)

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.1

What's Changed

Features

  • [jest-resolver] Implement the defaultAsyncResolver (#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 deprecate jest-repl package (#15673)
  • [jest-resolver] Replace custom isBuiltinModule with node's isBuiltin (#15685)

New Contributors

Full Changelog: https://github.com/jestjs/jest/blob/main/CHANGELOG.md

30.0.0

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.

Read the full blog post

Features

  • [*] Renamed globalsCleanupMode to globalsCleanup and --waitNextEventLoopTurnForUnhandledRejectionEvents to --waitForUnhandledRejections
  • [expect] Add ArrayOf asymmetric matcher for validating array elements. (#15567)
  • [babel-jest] Add option excludeJestPreset to allow opting out of babel-preset-jest (#15164)
  • [expect] Revert #15038 to fix expect(fn).toHaveBeenCalledWith(expect.objectContaining(...)) when there are multiple calls (#15508)
  • [jest-circus, jest-cli, jest-config] Add waitNextEventLoopTurnForUnhandledRejectionEvents flag to minimise performance impact of correct detection of unhandled promise rejections introduced in #14315 (#14681)
  • [jest-circus] Add a waitBeforeRetry option to jest.retryTimes (#14738)
  • [jest-circus] Add a retryImmediately option to jest.retryTimes (#14696)
  • [jest-circus, jest-jasmine2] Allow setupFilesAfterEnv to export an async function (#10962)
  • [jest-circus, jest-test-result] Add startedAt timestamp in TestCaseResultObject within onTestCaseResult (#15145)
  • [jest-cli] Export buildArgv (#15310)
  • [jest-config] [BREAKING] Add mts and cts to default moduleFileExtensions config (#14369)
  • [jest-config] [BREAKING] Update testMatch and testRegex default option for supporting mjs, cjs, mts, and cts (#14584)
  • [jest-config] Loads config file from provided path in package.json (#14044)
  • [jest-config] Allow loading jest.config.cts files (#14070)
  • [jest-config] Show rootDir in error message when a preset fails to load (#15194)
  • [jest-config] Support loading TS config files using esbuild-register via 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] Add perfStats to surface test setup overhead (#14622)
  • [@jest/core] [BREAKING] Changed --filter to accept an object with shape { filtered: Array<string> } to match documentation (#13319)
  • [@jest/core] Support --outputFile option for --listTests (#14980)
  • [@jest/core] Stringify Errors properly with --json flag (#15329)
  • [@jest/core, @jest/test-sequencer] [BREAKING] Exposes globalConfig & contexts to TestSequencer (#14535, & #14543)
  • [jest-each] Introduce %$ option to add number of the test to its title (#14710)
  • [@jest/environment] [BREAKING] Remove deprecated jest.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 the jsdom environment, allowing usage of custom versions of JSDOM (#14717)
  • [jest-environment-node] Update jest environment with dispose symbols Symbol (#14888 & #14909)
  • [expect, @jest/expect] [BREAKING] Add type inference for function parameters in CalledWith assertions (#15129)
  • [@jest/expect-utils] Properly compare all types of TypedArrays (#15178)
  • [@jest/fake-timers] [BREAKING] Upgrade @sinonjs/fake-timers to 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 with requestAnimationFrame (#14598)
  • [jest-matcher-utils] Add SERIALIZABLE_PROPERTIES to allow custom serialization of objects (#14893)
  • [jest-mock] Add support for the Explicit Resource Management proposal to use the using keyword with jest.spyOn(object, methodName) (#14895)
  • [jest-reporters] Add support for DEC mode 2026 (#15008)
  • [jest-resolver] Support file:// 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 function jest.advanceTimersToFrame() from @jest/fake-timers (#14598)
  • [jest-runtime] Support import.meta.filename and import.meta.dirname (available from Node 20.11) (#14854)
  • [jest-runtime] Support import.meta.resolve (#14930)
  • [jest-runtime] [BREAKING] Make it mandatory to pass globalConfig to the Runtime constructor (#15044)
  • [jest-runtime] Add unstable_unmockModule (#15080)
  • [jest-runtime] Add onGenerateMock transformer callback for auto generated callbacks (#15433 & #15482)
  • [jest-runtime] [BREAKING] Use vm.compileFunction over vm.Script (#15461)
  • [@jest/schemas] Upgrade @sinclair/typebox to v0.34 (#15450)
  • [@jest/types] test.each(): Accept a readonly (as const) table properly (#14565)
  • [@jest/types] Improve argument type inference passed to test and describe callback functions from each tables (#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 from jest-snapshot into its own package (#15095)
  • [pretty-format] [BREAKING] Do not render empty string children ('') in React plugin (#14470)

Fixes

  • [expect] Show AggregateError to display (#15346)
  • [*] Replace exit with exit-x (#15399)
  • [babel-plugin-jest-hoist] Use denylist instead of the deprecated blacklist for Babel 8 support (#14109)
  • [babel-plugin-jest-hoist] Do not rely on buggy Babel behaviour (#15415)
  • [expect] Check error instance type for toThrow/toThrowError (#14576)
  • [expect] Improve diff for failing expect.objectContaining (#15038)
  • [expect] Use Array.isArray to check if an array is an Array (#15101)
  • [expect] Fix Error cause assertion errors (#15339)
  • [jest-changed-files] Print underlying errors when VCS commands fail (#15052)
  • [jest-changed-files] Abort sl root call if output resembles a steam locomotive (#15053)
  • [jest-circus] [BREAKING] Prevent false test failures caused by promise rejections handled asynchronously (#14315)
  • [jest-circus] Replace recursive makeTestResults implementation with iterative one (#14760)
  • [jest-circus] Omit expect.hasAssertions() errors if a test already has errors (#14866)
  • [jest-circus, jest-expect, jest-snapshot] Pass test.failing tests 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 respect runInBand option (#14578)
  • [jest-config] Support testTimeout in project config (#14697)
  • [jest-config] Support coverageReporters in project config (#14697)
  • [jest-config] Allow reporters in project config (#14768)
  • [jest-config] Allow Node16/NodeNext/Bundler moduleResolution in project's tsconfig (#14739)
  • [@jest/create-cache-key-function] Correct the return type of createCacheKey (#15159)
  • [jest-each] Allow $keypath templates with null or undefined values (#14831)
  • [@jest/expect-utils] Fix comparison of DataView (#14408)
  • [@jest/expect-utils] [BREAKING] exclude non-enumerable in object matching (#14670)
  • [@jest/expect-utils] Fix comparison of URL (#14672)
  • [@jest/expect-utils] Check Symbol properties 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 multiple hasteImplModulePaths (#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 _importCoreModel so required core module is consistent if modified while loading (#15077)
  • [jest-schemas, jest-types] [BREAKING] Fix type of testFailureExitCode config option(#15232)
  • [jest-util] Make sure isInteractive works in a browser (#14552)
  • [pretty-format] [BREAKING] Print ArrayBuffer and DataView correctly (#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)
    • [BREAKING] Changes testPathPattern configuration option to testPathPatterns, which now takes a list of patterns instead of the regex.
    • [BREAKING] --testPathPattern is now --testPathPatterns
    • [BREAKING] Specifying testPathPatterns when programmatically calling watch must be specified as new TestPathPatterns(patterns), where TestPathPatterns can be imported from @jest/pattern
  • [jest-reporters, jest-runner] Unhandled errors without stack get correctly logged to console (#14619)
  • [jest-util] Always load mjs files with import (#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 where ObjectContaining matched non-object values. ([#15463])(#15463).
    • Adds a conditional/check to ensure the argument passed to expect is an object.
    • Add unit tests for new ObjectContaining behavior.
    • Remove invalid/wrong test case assertions for ObjectContaining.
  • [jest-worker] Addresses incorrect state on exit (#15610)

Performance

  • [*] [BREAKING] Bundle all of Jest's modules into index.js (#12348, #14550 & #14661)
  • [jest-haste-map] Only spawn one process to check for watchman installation (#14826)
  • [jest-runner] Better cleanup source-map-support after test to resolve (minor) memory leak (#15233)
  • [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 (#15325CVE-2024-37890)
  • [*] Increase version of micromatch to ^4.0.7 (#15082)
  • [*] [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 now 5.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 to glob@10 (#14509)
  • [*] Use TypeError over Error where appropriate (#14799)
  • [docs] Fix typos in CHANGELOG.md and packages/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/core to ^7.11 (#14109)
  • [babel-jest, @jest/transform] Update babel-plugin-istanbul to v6 (#15156)
  • [babel-plugin-jest-hoist] Move unnecessary dependencies to devDependencies (#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 --init argument (#14490)
  • [jest-config, @jest/core, jest-util] Upgrade ci-info (#14655)
  • [jest-mock] [BREAKING] Remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
  • [@jest/reporters] Upgrade istanbul-lib-source-maps (#14924)
  • [jest-schemas] Upgrade @sinclair/typebox (#14775)
  • [jest-transform] Upgrade write-file-atomic (#14274)
  • [jest-util] Upgrade picomatch to 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)

See the CHANGELOG.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ pure-rand (indirect, 6.1.0 → 7.0.1) · Repo · Changelog

Release Notes

7.0.1 (from changelog)

Fixes

  • c24bc93 🐛 Properly define exports in package.json (#758)

7.0.0 (from changelog)

Breaking Changes

  • 2c94832 🏷️ Move to "import type" when feasible (#736)
  • 3741a63 🏷️ Mark getState as compulsory on RandomGenerator (#733)

Features

  • 228c73d ⚡️ Faster uniform distributions on bigint (#757)
  • 86869a1 ✨ Expose generators and distributions (#735)

Fixes

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 60 commits:

↗️ semver (indirect, 7.6.3 → 7.7.3) · Repo · Changelog

Release Notes

7.7.3

7.7.3 (2025-10-06)

Bug Fixes

Chores

7.7.2

7.7.2 (2025-05-12)

Bug Fixes

Chores

7.7.1

7.7.1 (2025-02-03)

Bug Fixes

7.7.0

7.7.0 (2025-01-29)

Features

Bug Fixes

Documentation

Chores

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 26 commits:

↗️ signal-exit (indirect, 3.0.7 → 4.1.0) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 19 commits:

↗️ string-width (indirect, 4.2.3 → 5.1.2) · Repo

Release Notes

5.1.2

v5.1.1...v5.1.2

5.1.1

  • Fix incorrect default for ambiguousIsNarrow option 483baa1

v5.1.0...v5.1.1

5.1.0

v5.0.1...v5.1.0

5.0.1

v5.0.0...v5.0.1

5.0.0

Breaking

v4.2.2...v5.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 51 commits:

↗️ strip-ansi (indirect, 6.0.1 → 7.1.2) · Repo

Release Notes

7.1.2


v7.1.0...v7.1.2

7.1.0

v7.0.1...v7.1.0

7.0.1

v7.0.0...v7.0.1

7.0.0

Breaking

v6.0.0...v7.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 71 commits:

↗️ wrap-ansi (indirect, 7.0.0 → 8.1.0) · Repo

Release Notes

8.1.0

v8.0.1...v8.1.0

8.0.1

v8.0.0...v8.0.1

8.0.0

Breaking

v7.0.0...v8.0.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 8 commits:

↗️ write-file-atomic (indirect, 4.0.2 → 5.0.1) · Repo · Changelog

Release Notes

5.0.1

5.0.1 (2023-04-26)

Dependencies

5.0.0

5.0.0 (2022-10-10)

⚠️ BREAKING CHANGES

  • write-file-atomic is now compatible with the following semver range for node: ^14.17.0 || ^16.13.0 || >=18.0.0

Features

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 31 commits:

🆕 @​emnapi/core (added, 1.5.0)

🆕 @​emnapi/runtime (added, 1.5.0)

🆕 @​emnapi/wasi-threads (added, 1.1.0)

🆕 @​isaacs/cliui (added, 8.0.2)

🆕 @​jest/diff-sequences (added, 30.0.1)

🆕 @​jest/get-type (added, 30.1.0)

🆕 @​jest/pattern (added, 30.0.1)

🆕 @​jest/snapshot-utils (added, 30.2.0)

🆕 @​napi-rs/wasm-runtime (added, 0.2.12)

🆕 @​pkgjs/parseargs (added, 0.11.0)

🆕 @​pkgr/core (added, 0.2.9)

🆕 @​tybys/wasm-util (added, 0.10.1)

🆕 @​ungap/structured-clone (added, 1.3.0)

🆕 @​unrs/resolver-binding-android-arm-eabi (added, 1.11.1)

🆕 @​unrs/resolver-binding-android-arm64 (added, 1.11.1)

🆕 @​unrs/resolver-binding-darwin-arm64 (added, 1.11.1)

🆕 @​unrs/resolver-binding-darwin-x64 (added, 1.11.1)

🆕 @​unrs/resolver-binding-freebsd-x64 (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-arm-gnueabihf (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-arm-musleabihf (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-arm64-gnu (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-arm64-musl (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-ppc64-gnu (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-riscv64-gnu (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-riscv64-musl (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-s390x-gnu (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-x64-gnu (added, 1.11.1)

🆕 @​unrs/resolver-binding-linux-x64-musl (added, 1.11.1)

🆕 @​unrs/resolver-binding-wasm32-wasi (added, 1.11.1)

🆕 @​unrs/resolver-binding-win32-arm64-msvc (added, 1.11.1)

🆕 @​unrs/resolver-binding-win32-ia32-msvc (added, 1.11.1)

🆕 @​unrs/resolver-binding-win32-x64-msvc (added, 1.11.1)

🆕 eastasianwidth (added, 0.2.0)

🆕 exit-x (added, 0.2.2)

🆕 foreground-child (added, 3.3.1)

🆕 jackspeak (added, 3.4.3)

🆕 minipass (added, 7.1.2)

🆕 napi-postinstall (added, 0.3.4)

🆕 package-json-from-dist (added, 1.0.1)

🆕 path-scurry (added, 1.11.1)

🆕 string-width-cjs (added, npm:string-width@4.2.3)

🆕 strip-ansi-cjs (added, npm:strip-ansi@6.0.1)

🆕 synckit (added, 0.11.11)

🆕 unrs-resolver (added, 1.11.1)

🆕 wrap-ansi-cjs (added, npm:wrap-ansi@7.0.0)

🗑️ create-jest (removed)

🗑️ diff-sequences (removed)

🗑️ exit (removed)

🗑️ jest-get-type (removed)

🗑️ kleur (removed)

🗑️ prompts (removed)

🗑️ resolve.exports (removed)

🗑️ sisteransi (removed)