Never miss a release that matters
AI-powered summaries of every GitHub release.
AI Summaries
Changelogs condensed into clear, actionable insights.
Always Free
Track up to 5 packages at no cost, forever.
Weekly Digest
A curated summary of every release, delivered weekly.
TL;DR
Jest now supports requiring ES modules with require() and offers improved Temporal API (date/time) support via fake timers, preparing for native ESM stabilization.
New
- Support for
require()of ES modules on Node v24.9+. - Fake timers now work with the
TemporalAPI. - Added
--collect-testsflag to list tests without running them.
Fixes Worth Knowing
- Fixed issues with
toStrictEqualfailing onstructuredCloneresults. - Corrected handling of default exports when importing CJS modules in ESM contexts.
- React 19 components now display correctly in snapshot output.
Before You Upgrade
If you are using ESM and require(), ensure you are on Node v24.9 or later.
TL;DR
Jest 30 drops support for Node.js 16 and includes several fixes to improve stability and correctness, particularly around module loading and error handling.
Breaking
- Node.js 16 Support Dropped: (Programming language runtime) Projects must upgrade to Node.js 18 or higher.
New
- ArrayOf Matcher: (Asymmetric matcher) A new
ArrayOfmatcher allows for more precise array comparisons in tests.
Fixes Worth Knowing
- Module Loading: Fixed issues with loading stub modules and core modules consistently.
- Error Display: Improved display of
AggregateError(grouped errors) for better debugging. objectContainingMatcher: Corrected a bug whereobjectContainingincorrectly matched non-object values.- Worker Stability: Addressed worker state issues for more reliable test execution.
TL;DR
Jest now supports initializing new projects directly from the command line using npm init or yarn create, simplifying setup.
Fixes Worth Knowing
moduleNameMappernow handles unmatched capture groups correctly, preventing errors.- Inline snapshots now accept strings in addition to template literals.
- Test runtime calculations are more reliable when
perStats.durationis missing.
TL;DR
Jest’s mocking utilities have been overhauled, providing more precise and flexible control over mock implementations, and now deeply mock by default.
Breaking
jest.mockedhelper now deeply mocks by default (creates mocks of all properties).Mocked*utility types have been reworked (TypeScript definitions for mocks).
New
- New
jest.Mocked,jest.MockedClass,jest.MockedFunction, andjest.MockedObjectutility types (TypeScript helpers for defining mock types) are now available. - Circus runner (Jest’s test runner) now includes
eachfor failing tests.
Fixes Worth Knowing
- Inline snapshot updates now work correctly with JSX (JavaScript XML).
- Jest can now find your Babel (JavaScript compiler) configuration when updating inline snapshots.
TL;DR
Jest now uses a more efficient method for leak detection, removing an external C dependency and improving performance.
Fixes Worth Knowing
jest-changed-files: Resolved an issue causing lock-ups with repeated use.@jest/expect-utils: Corrected deep equality comparisons for ImmutableJS OrderedSets (data structures).jest-snapshot: Fixed indentation issues when using awaited inline snapshots.jest-mock: Improved type support forspyOnwhen working with objects with index signatures (dynamic keys).
TL;DR
Jest gains experimental support for import.meta.jest (runtime metadata) and a new GitHub Actions reporter, alongside several breaking changes preparing for v28.
Breaking
rootDirinbabel-jestnow passed asroot(Babel configuration).TestWatcherclass moved to thejest-watcherpackage (testing architecture).Contexttype must be imported from@jest/test-result(test context).process()andprocessAsync()injest-transformmust return structured data (test transformation).- Dropped support for
[email protected]– minimum version is now4.3(TypeScript compatibility). - Config option
namerenamed toid(Jest configuration). - Second argument to runner constructors is now required (test runner customization).
- Default advanced serialization for child process workers (worker process behavior).
New
- GitHub Actions reporter (CI/CD integration).
import.meta.jestprovides runtime information about the Jest environment (runtime metadata).
Fixes Worth Knowing
- Improved error messages for
TL;DR
Jest now includes expect.closeTo (numeric comparison matcher) and mockFn.mock.lastCall (accessing the last arguments of a mock function), improving testing flexibility.
New
- Added
expect.closeTofor more readable numeric comparisons. mockFn.mock.lastCallallows retrieving the arguments from the most recent mock function call.
Fixes Worth Knowing
- Improved support for
.toHaveProperty('')anddescribe.each/test.eachwithReadonlyArraytypes. - Fixed issues with snapshot matching for
.mjsfiles and asymmetric matchers. - Added
atobandbtoafunctions to the Node.js testing environment.
Before You Upgrade
No specific upgrade steps are required.
TL;DR
Jest now supports top-level await in tests and improves ESM (EcmaScript Modules) support, enabling better compatibility with modern JavaScript projects.
Fixes Worth Knowing
- Fixed an issue where Jest would sometimes fail to resolve mock dependencies.
- Corrected an error with
objectContainingmatchers. - Improved error messages for missing preset modules.
- Resolved issues with dynamic imports and file URLs.
- Addressed a bug in watch mode related to configuration updates.
Before You Upgrade
If you are using TypeScript, review the updated documentation for using mocks to ensure compatibility with the newer Jest types.
TL;DR
Jest now supports importing CommonJS (CJS) modules from ECMAScript Modules (ESM) using import statements, improving interoperability between different module types.
New
- Explicitly import Jest globals via the new
@jest/globalspackage. - Coverage reports now include sources related to changed files, speeding up focused testing.
Fixes Worth Knowing
beforeAllandafterAllhooks will no longer run in skipped test blocks, resolving unexpected behavior.- Improved error messages now display Symbol names for custom matchers.
- Fixed a memory leak when running tests in band (concurrent tests limited to a single worker).
Before You Upgrade
- If you explicitly import Jest globals, update your imports to use the
@jest/globalspackage.
TL;DR
Jest 24 introduces significant performance improvements, including faster test execution and reduced memory usage, alongside a major migration to TypeScript for improved maintainability.
Breaking
- Removed support for
@providesModule. - Dropped Babel 6 support, requiring Node.js 6+.
- Removed long-deprecated globals for fake timers.
setupTestFrameworkScriptFileis deprecated, usesetupFilesAfterEnvinstead.- Changes to worker thread functionality and configuration.
diffpackage replaced withdiff-sequences.- Error process codes are only set when non-zero.
New
- Added
jest.isolateModulesfor scoped module initialization. - Support for custom test sequencers via
testSequencerconfiguration option. - Node worker thread support for parallel test execution.
Fixes Worth Knowing
- Fixed issues with mocks not working with module name mappers.
- Corrected coverage data for untested files.
- Resolved memory leaks in various areas, including Jasmine and the console.
- Improved error messages and stack traces.
- Fixed issues with
requireActualand module resolution.
Before You Upgrade
- Update your Babel configuration to Babel
TL;DR
Jest now supports inline snapshots and property matchers, significantly improving snapshot testing workflow and readability.
Breaking
toMatchSnapshotnow concatenates the test name, optional snapshot name, and a count into the snapshot filename.- Mocked functions no longer track timestamps, using
invocationCallOrderinstead. babel-jesttransformers must always return an object.jest.genMockFnandjest.genMockFunctionhave been removed.pretty-formatno longer includes undefined props in React elements.
New
- Inline snapshots (
toMatchInlineSnapshot,toThrowErrorMatchingInlineSnapshot) offer a more streamlined snapshot experience. - Property matchers allow for more focused snapshot comparisons.
- Watch plugins can now be configured and have access to more global configuration options.
Fixes Worth Knowing
- Improved error messages for invalid arguments to
it/test. - Fixed issues with mocking and spying on properties, including prototype chains.
- Resolved problems with coverage reporting and test execution in watch mode.
- Corrected handling of symbolic properties in equality checks.
- Fixed issues with
TL;DR
Jest v22 introduces significant performance improvements with parallel workers and updates to core dependencies like JSDOM (v11). Major features include enhanced test reporting, improved snapshot testing, and more flexible configuration options.
Breaking
toBematcher now usesObject.isfor equality checks.- JSDOM upgraded to v11, potentially impacting tests relying on specific JSDOM behavior.
- Asynchronous Test Environment APIs changed;
disposeis nowteardown. - Support for Node.js version 4 has been dropped.
- Snapshot names now concatenate test and snapshot names.
- Jest now fails if no tests are found.
New
- Parallel test execution via worker abstraction for faster test runs.
- Codeframe added to test assertion failures for easier debugging.
- Global setup/teardown options for running code before/after all tests.
Fixes Worth Knowing
- Improved handling of Windows paths and file system interactions.
- Fixed issues with coverage collection and reporting.
- Resolved problems with mocking and module resolution.
- Fixed errors related to snapshot testing and diffing.
TL;DR
Jest has been significantly updated with new features for filtering tests and improved debugging, including options to run tests only for changed files and better source map support.
Breaking
- ES Module Exports: Jest now uses ES module exports, potentially impacting builds if you were relying on CommonJS.
- Jasmine Replacement: The underlying test runner has moved from Jasmine to
jest-circus.
New
- Changed File Testing: Run tests only for changed files with
--changedFilesWithAncestorand--onlyChanged. - Improved Debugging: Source map support and better stack traces enhance the debugging experience.
Fixes Worth Knowing
- Fixed issues with
--watchAllnot running tests on save and problems with--silent --verbose. - Resolved a race condition with coverage generation and Babel.
- Corrected issues with mocking functions and handling Map/Set equality.
- Improved error messages for
toBeCalledWithandtoMatchObjectassertions.
Before You Upgrade
- If you are importing Jest modules directly, verify your build process supports ES modules.
- Review your test setup to ensure compatibility with
jest-circus.
TL;DR
Jest received a major overhaul, introducing multi-project testing and significant improvements to asynchronous testing with promise support for matchers like .resolves and .rejects.
Breaking
- Jest no longer writes new snapshots by default on CI (Continuous Integration) environments.
- The typescript parser moved to a separate package (
jest-test-typescript-parser). - Removed automatic loading of
babel-polyfill, now only usesregenerator-runtime(runtime environment). - Jest’s test runner was completely rewritten, forking from Jasmine 2.5.
New
- Run tests across multiple projects simultaneously with the new
--projectsoption. - Use the
--listTestsflag to display a list of tests. - View your Jest configuration with the
--showConfigflag.
Fixes Worth Knowing
- Fixed issues with progress bars on Windows.
- Corrected handling of duplicate module IDs and
<rootDir>replacement. - Improved stability with watchers on macOS.
- Fixed several bugs related to mocking, timers, and snapshot serialization.
TL;DR
Jest received a major overhaul with a rewritten watch mode (file watching for test reruns) and significant configuration changes, improving performance and developer experience.
Breaking
mocksPatternremoved (never worked correctly).testPathDirsrenamed toroots(clarifies configuration).- Snapshot format updated (properly escapes data).
- React element printing changed (reduces unnecessary snapshot changes).
New
--collectCoverageFromand--coverageDirectoryCLI arguments (more control over coverage reports).expect.addSnapshotSerializer(allows custom snapshot handling for complex data types).jest.spyOn(easier and more robust mocking of methods).
Fixes Worth Knowing
- Fixed infinite loop with
--watchand--coverage. - Corrected
--colorargument recognition. - Resolved issues with console.log and memory leaks.
- Fixed handling of invalid CLI options.
Before You Upgrade
- Update your Jest configuration to use
rootsinstead oftestPathDirs. - Review your snapshot files, as the format has changed and may require updates.
TL;DR
Jest now includes more flexible matchers (like expect.any and expect.objectContaining) and improved snapshot testing, but requires updating how custom test result processors are configured.
Breaking
testResultsProcessornow requires returning modified results.pitandmockImplare removed; useitandmockImplementationinstead.--jsonOutputFileis renamed to--outputFile.
New
- Added flexible matchers for more precise assertions (expect.any, expect.objectContaining).
- Improved snapshot testing with named snapshots (
.toMatchSnapshot(?string)) and regex escaping.
Fixes Worth Knowing
- Corrected test behavior with
--bailand--watch. - Fixed issues with
require('v8')andtest.concurrent. - Improved error messages for invalid configurations.
- Enhanced display of large objects in diffs.
Before You Upgrade
- Update any custom
testResultsProcessorimplementations to return the modified test results.
TL;DR
Jest now collapses large snapshot diffs by default, improving readability, and can be expanded with the --expand flag (command line option).
Breaking
scriptPreprocessoris removed, usetransforminstead (configuration option).jest.clearAllMocksis replaced byjest.resetAllMocks(mocking function).
New
expect.extendallows for custom matchers (assertion extensions).- Custom snapshot serializers are now supported (snapshot testing).
Fixes Worth Knowing
- Improved performance of module resolution.
- Correctly handles React Native projects with platform-specific files.
- Improved printing of large objects in test output.
Before You Upgrade
- Replace any uses of
scriptPreprocessorwithtransformin your Jest configuration. - Update your tests to use
jest.resetAllMocksinstead ofjest.clearAllMocks.
TL;DR
Jest now runs failed tests first and includes a new concurrent reporter, improving the developer experience when diagnosing and monitoring test runs.
Breaking
- Snapshots require updating due to a rewrite of the snapshot implementation.
New
- Concurrent Reporter: Displays currently running tests, a summary, progress bar, and estimated time.
- Test Filtering: Run individual tests with
--testNamePatternor-t <pattern>. - Concurrent Async Tests: Use
test.concurrentto run async tests in parallel.
Fixes Worth Knowing
- Symbols are now correctly mocked with
jest-mock. toHaveBeenCalledWith()now functions as expected.- Newlines in snapshots are consistently handled across operating systems.
Before You Upgrade
- Update your snapshots after upgrading, as the snapshot implementation has been rewritten.
TL;DR
Jest now includes improved matchers and CLI output, and automatically recognizes .spec.js and .test.js files, simplifying test setup.
Breaking
- Matchers have been completely rewritten (testing assertions).
- Automocking, fake timers, and module registry resetting are disabled by default (test isolation).
New
- Improved watch mode allows updating snapshots and selecting test patterns interactively (test execution).
- Enhanced code coverage support now collects data from untested files (code quality).
Fixes Worth Knowing
- Test paths with hyphens now work correctly on Windows (file system compatibility).
afterAll/afterEach/beforeAll/beforeEachnow support Promises andasync/await(asynchronous testing).
Before You Upgrade
- Review your existing tests to account for the new Jest matchers.
TL;DR
Jest now fully supports snapshot tests and replaces Jasmine matchers with its own, offering a more consistent testing experience.
Breaking
- Jasmine 1 support removed (older testing framework).
- Jest matchers replaced (expect syntax changes).
New
- Snapshot tests are now officially supported (record and compare UI/data).
- Experimental React Native support added (test mobile applications).
Fixes Worth Knowing
babel-jestnow composes transformers correctly (improves build process).- Configuration now accepts JSON objects (easier setup).
Before You Upgrade
Run jest -u or npm test -- -u to update existing snapshots after upgrading.
TL;DR
Jest now includes more detailed test reporting, a REPL (Read-Eval-Print Loop) for interactive debugging, and improved snapshot testing, making it easier to diagnose and understand test results.
Breaking
testchecknow requires explicit import (require('jest-check')) as a separate package.jest-cliis now split intojest-runtimeandjest-config.
New
jest.isMockFunction()allows you to reliably check if a function is a mock.browserconfig option supports testing client-side apps (web browser code).
Fixes Worth Knowing
- Improved snapshot output for JSX objects.
- Corrected issues with the
--verboseflag and top-levelitcalls.
Before You Upgrade
- If you are using
testcheck, update your imports torequire('jest-check').
TL;DR
Jest now natively supports asynchronous tests with Promises, and offers more flexible test discovery with testRegex, improving usability for modern JavaScript projects.
Breaking
testDirectoryNameandtestFileExtensionsare deprecated (configuration options).pitis deprecated (asynchronous test syntax).
New
- Asynchronous tests are now supported by returning a Promise from
itblocks. testRegexallows matching tests outside of default folders (test discovery).
Fixes Worth Knowing
- Improved stability on Windows.
- Corrected issues with single test file execution and scoped packages.
- Enhanced
lastCalledWithandtoBeCalledWithmatchers (assertion helpers) to display recent calls.
Before You Upgrade
- Update your test configuration to use
testRegexinstead oftestDirectoryNameandtestFileExtensions. - Replace
pitwith Promise-returningitblocks for asynchronous tests.
TL;DR
Jest now cleans up test environments properly, resolving a memory leak and offering a --logHeapUsage flag for debugging. Several dependency updates, including jsdom, improve stability and performance.
Breaking
- Removed undocumented public API:
mock-modules,node-haste, andmocksvirtual modules. Use the provided codemod to update. - Removed
navigator.onLineandmockSetReadOnlyPropertyfrom the jsdom environment; use standard JavaScript methods instead. - Jest now requires iojs v2 or later; upgrade from Node.js if possible.
toEqualnow strictly checks object class names, fixing previously incorrect passing tests.- Preprocessor API changed to receive script, file, and config.
New
- Print test results as JSON with the
--jsonoption. - Use
--watchto re-run tests on file changes. - Configure a custom
testRunnerfor more control over test execution.
Fixes Worth Knowing
- Corrected error reporting for the
--bailflag. - Fixed syntax error reporting and improved failure stack traces.
- Resolved issues with mocking Map, WeakMap, and Set objects.