jestjs/jest
45.9
Weak · 28 September 2026
63.1k
lines of production code
TypeScript
with JavaScript
3
measurements over time
What this system is
This system is Jest, a JavaScript testing framework that provides a comprehensive infrastructure for running, managing, and reporting on unit and integration tests. It features a modular architecture with dedicated packages for test execution, module resolution, code transformation, and assertion matching, supporting both CommonJS and ES modules. The framework includes interactive CLI tools, watch mode plugins, and extensive example suites for modern JavaScript ecosystems like React, TypeScript, and Angular.
How it got here
2014–2017 — Legacy cleanup and modernization
50 changes.
This period focused on removing legacy infrastructure, including the old test runners, module loaders, and CoffeeScript examples, to streamline the codebase. The project simultaneously modernized its remaining examples and internal packages by migrating to ES6+, Babel 7, and TypeScript, while introducing new standalone packages like babel-preset-jest.
2018–2019 — TypeScript migration and ESM modernization
92 changes.
This period focused on migrating the majority of Jest's core packages from JavaScript to TypeScript and converting the build system to native ESM. The work included rewriting critical components like the test runner, resolver, and diff engine, while also extracting logic into standalone packages such as jest-fake-timers and jest-test-result. Additionally, the team updated examples to modern standards and enhanced internal tooling with new e2e infrastructure and AI agent support.
2020–2026 — modularization and explicit globals
46 changes.
This period focused on restructuring Jest into a modular monorepo by introducing dedicated packages for schemas, expectations, and global imports to improve type safety and explicitness. Significant architectural changes included decomposing the runtime into specialized modules, replacing native file watchers with @parcel/watcher, and adding interactive watch mode plugins. The work was heavily supported by comprehensive test coverage, including new type tests, benchmarks, and end-to-end fixtures for the expanded package ecosystem.
Features
Add Angular example with Jest testing
The Angular example now includes a complete test suite using Jest and jest-preset-angular. This adds unit tests for the main application component and its shared services (DataService, SubService), configured via a dedicated jest.config.js and setupJest.js file, allowing users to verify the example's behavior and structure.
examples/angular · high confidence
Add Phabricator coverage processor for Jest
A new \PhabricatorProcessor\ has been added to the \jest-phabricator\ package, allowing users to integrate Jest test results with Phabricator's code review tooling. This processor transforms the coverage map data into a format suitable for Phabricator by summarizing line coverage status (Covered, Uncovered, Not Executed) for each file.
packages/jest-phabricator/src · high confidence
Add React Native example with Jest configuration
Introduces a new React Native example application (\examples/react-native\) that demonstrates how to configure Jest for React Native projects. The example includes a basic app structure (\Intro.js\, \index.js\) and a \jest.config.js\ file that sets the \@react-native/jest-preset\ and configures \transformIgnorePatterns\ to handle internal package transformations. It also provides necessary build and environment configuration files such as \.buckconfig\, \.gitignore\, and \babel.config.js\ using the \@react-native/babel-preset\.
examples/react-native · high confidence
Add React Testing Library example with modern React patterns
A new example demonstrating React Testing Library has been added to the examples directory. The example includes a Babel configuration using @babel/preset-react with the automatic runtime and a functional component (CheckboxWithLabel) that utilizes the useState hook and functional state updates, reflecting current React best practices.
examples/react-testing-library · high confidence
Add TypeScript + React working samples
The examples/typescript directory now includes a complete, runnable TypeScript + React example. It provides sample components (CheckboxWithLabel), utility modules (Memory, calc, sum, sub), and configuration files (.babelrc.js, tsconfig.json, setupTests.ts) to demonstrate how to set up and run TypeScript with React in this environment.
examples/typescript · high confidence
Add async example with Babel 7 configuration
The async example now includes a Babel 7 configuration file (.babelrc.js) using @babel/preset-env for the current Node.js version, and introduces new source files (request.js, user.js) demonstrating asynchronous HTTP requests using Promises and ES modules.
examples/async · high confidence
Add example for extending expect with a custom matcher
The \examples/expect-extend\ directory now includes a complete example demonstrating how to create and register a custom \expect\ matcher. It provides a \toBeWithinRange\ implementation that validates if a number falls within a specified floor and ceiling, including proper TypeScript typing via \MatcherFunction\ and module augmentation for \AsymmetricMatchers\ and \Matchers\. The example also includes corresponding tests covering standard usage, negation, and asymmetric matchers.
examples/expect-extend · high confidence
Add interactive \`create-jest\` initializer for scaffolding project configuration
The \packages/create-jest\ package now provides an interactive CLI tool (invoked via \npm init jest-app\ or \yarn create jest-app\) that scaffolds a Jest configuration for existing projects. It prompts users to select options such as TypeScript support, test environment (Node.js or jsdom), coverage provider (v8 or babel), and whether to add a test script to \package.json\. Based on these choices, it generates a typed or untyped config file (\.js\, \.mjs\, or \.ts\) and updates \package.json\ accordingly, while safely handling cases where a configuration already exists.
packages/create-jest/src · high confidence
Add manual mock examples for fs, lodash, and user modules
The examples/manual-mocks directory now includes concrete manual mock implementations for the Node.js 'fs' module, the 'lodash' library, and a custom 'user' model. These files demonstrate how to use jest.createMockFromModule to generate mocks and override specific behaviors, such as custom file system state management for 'fs', forcing a return value for 'lodash.head', and mocking user authentication data.
examples/manual-mocks/\\mocks\\_ · high confidence_
Added automatic mocks example demonstrating module mocking capabilities
The examples/automatic-mocks directory now includes a complete example showcasing Jest's automatic mocking features. It demonstrates how modules are automatically mocked by default, how to use jest.createMockFromModule to create mocks from existing modules, and how to disable automocking to use original implementations. The example includes a utils module with authorization functions and corresponding tests illustrating these behaviors.
examples/automatic-mocks · high confidence
Added benchmark suite comparing diff-sequences performance against the diff package
A new benchmark suite has been added to the diff-sequences package to measure and compare its performance against the standard \diff\ library. The suite includes a Node.js test script (\test.js\) that runs performance tests on various input sizes (n=20, 200, 2000) and change types (delete, insert, change), outputting results in Markdown format (\example.md\) to demonstrate that \diff-sequences\ is significantly faster across these scenarios.
packages/diff-sequences/\\benchmarks\\_ · high confidence_
Added mock for async request in examples
A new mock implementation for the \request\ function has been added to the async example suite. This mock simulates asynchronous user data retrieval by returning a Promise that resolves with predefined user objects (Mark, Paul) or rejects with a 'not found' error, enabling the async example to run without external network dependencies.
examples/async/\\mocks\\_ · high confidence_
Added mock implementations for fs, os, and read-pkg modules
Jest now provides built-in mock modules for the Node.js \fs\, \os\, and \read-pkg\ packages within the \jest-config\ package. These mocks allow tests to easily simulate file system operations, CPU availability, and package metadata reading by exposing helper methods like \\_\setMockFiles\ and \\\_setCpus\ to configure the mocked behavior, ensuring consistent and isolated test environments without relying on the actual underlying system resources.
packages/jest-config/src/\\mocks\\_ · high confidence_
Added test-file-overhead benchmark for measuring Jest startup performance
A new benchmark suite named \test-file-overhead\ has been added to the \benchmarks\ directory. This suite includes a script (\prepare.sh\) that generates 499 empty test files to simulate a large test suite, allowing users to measure and compare Jest's startup and file-loading overhead using tools like hyperfine. The benchmark directory also includes a \.gitignore\ to exclude the generated test files and a \README\ with instructions on how to run the comparison.
benchmarks · high confidence
Explicit global imports via @jest/globals package
The new @jest/globals package allows users to explicitly import Jest globals (such as \it\, \test\, \describe\, \expect\, and \jest\) instead of relying on implicit global variables. This entry provides type declarations for the standard test functions and the \jest\ object, including utility types for mocking (\Mock\, \Mocked\, \Spied\, etc.) re-exported from \jest-mock\. The package enforces that these imports are only used within the Jest test environment by throwing an error if imported elsewhere, supporting stricter linting and better IDE support for global symbols.
packages/jest-globals/src · high confidence
Initial release of babel-preset-jest package
The \babel-preset-jest\ package is introduced as a standalone Babel preset that configures Babel with \babel-plugin-jest-hoist\ and \babel-preset-current-node-syntax\. This allows users to explicitly apply Jest-specific Babel transformations via \babel.config.js\, the CLI, or the Node API, independent of \babel-jest\. The package includes standard distribution files, documentation, and an \.npmignore\ to exclude source and test artifacts from the published module.
packages/babel-preset-jest · high confidence
Initial release of the standalone @jest/test-sequencer package
The test sequencing logic has been extracted into a new, standalone package (\packages/jest-test-sequencer\). This change introduces the \TestSequencer\ class, which manages test execution order by sorting tests based on failure history, runtime duration, and file size, and supports distributing tests across multiple workers via the \--shard\ option. The package includes its own build configuration (\tsconfig.json\) and test suite (\test\_sequencer.test.ts\), ensuring the sequencing behavior is isolated and independently maintainable.
packages/jest-test-sequencer · high confidence
Introduce @jest/console package with buffered and custom console implementations
The \@jest/console\ package has been created, providing \BufferedConsole\ for capturing console output into a buffer (useful for reporters and assertions), \CustomConsole\ for writing to stdout/stderr with formatting, and \NullConsole\ for suppressing output. It also exports \getConsoleOutput\ to format buffered logs for display, supporting stack traces and code frames for errors and warnings. This refactors the console handling logic into a dedicated package, separating concerns between buffering, output formatting, and actual I/O.
packages/jest-console/src · high confidence
Introduce @jest/pattern package for test path matching
The new \@jest/pattern\ package provides the core logic for parsing and matching test path patterns. It introduces \TestPathPatterns\ and \TestPathPatternsExecutor\ classes that handle pattern validation, relative/absolute path resolution, and case-insensitive matching. The implementation includes specific fixes for Windows path separators (handling both \\\\ and \/\) and explicit relative paths (like \./foo.spec.js\), ensuring consistent test selection across different operating systems.
packages/jest-pattern · high confidence
Introduce @jest/schemas package for centralized type definitions
A new \@jest/schemas\ package has been added to centralize Jest's configuration and runtime type definitions. This package exports schema definitions for \InitialOptions\, \SnapshotFormat\, and \FakeTimers\ using \@sinclair/typebox\, providing a single source of truth for these types across the Jest ecosystem.
packages/jest-schemas/src · high confidence
Introduce dedicated @jest/test-result package with new formatting and helper utilities
This change extracts test-result logic into a new \@jest/test-result\ package, providing a \formatTestResults\ function that maps internal test data to a \FormattedTestResult\ structure. The formatter now explicitly supports \skipped\ and \focused\ statuses in the output, and the package includes helper utilities like \makeCollectedTestResult\ for tallying per-status counts and \makeEmptyAggregatedTestResult\ for creating empty result containers. The package also defines its own TypeScript types (e.g., \FormattedTestResult\, \AggregatedResult\) and exports these alongside the new formatting logic, while excluding test and build artifacts via \.npmignore\.
packages/jest-test-result · high confidence
Jest now displays Error.cause and AggregateError details in test output
The \jest-message-util\ package has been migrated to TypeScript and updated to recognize and display nested error information. When a test fails with an \Error\ that has a \cause\ property, Jest now prints the cause's message and stack trace under a 'Cause:' section. Additionally, \AggregateError\ objects are supported, with Jest iterating over their \errors\ array to display each sub-error's details. This provides clearer context for debugging complex failure scenarios where errors are wrapped or aggregated.
packages/jest-message-util/src · high confidence
Migrate jest-changed-files to TypeScript and add Sapling support
The \jest-changed-files\ package has been rewritten in TypeScript, introducing a modular adapter pattern for source control systems. This change adds native support for Sapling (sl) alongside existing Git and Mercurial (hg) integration, allowing users with Sapling repositories to use \--changedSince\ and related flags. The implementation also refactors how changed files are collected, ensuring that staged files are included when using \--only-changed\, and improves root detection reliability for all supported version control systems.
packages/jest-changed-files/src · high confidence
Migrate jest-get-type to TypeScript with BigInt and isPrimitive support
The \jest-get-type\ package has been rewritten in TypeScript, introducing native support for the \bigint\ type in its return values and adding a new \isPrimitive\ utility function to check for primitive values. This update ensures accurate type detection for modern JavaScript types and provides a convenient helper for primitive validation.
packages/jest-get-type/src · high confidence
New @jest/expect package with Jest-specific expect types and snapshot integration
The new \@jest/expect\ package (located in \packages/jest-expect/src\) provides a \jestExpect\ function that extends the core \expect\ API with Jest-specific snapshot matchers (\toMatchSnapshot\, \toMatchInlineSnapshot\, etc.) and adds a \testFailing\ flag to \MatcherState\ to support \test.failing()\ scenarios. It also exports refined TypeScript types (\JestExpect\, \JestMatchers\, \PromiseMatchers\) that combine standard matchers with snapshot capabilities and inverse assertions, ensuring type safety for Jest-specific features like \resolves\ and \rejects\.
packages/jest-expect/src · high confidence
New @jest/snapshot-utils package with cross-platform snapshot handling
Jest now exports a new \@jest/snapshot-utils\ package containing core snapshot utilities. This package ensures snapshot files are handled consistently across operating systems by normalizing line endings (converting Windows CRLF and old Mac CR to Unix LF) when saving snapshots, and correctly escaping/unescaping them in test names to prevent collisions. It also validates snapshot headers, detecting outdated versions and replacing the deprecated \goo.gl\ guide link with the canonical \jestjs.io\ URL, throwing clear errors if these checks fail during non-update runs.
packages/jest-snapshot-utils · high confidence
New @jest/test-utils package for internal test infrastructure
The new private \@jest/test-utils\ package consolidates shared utilities for Jest's internal end-to-end and package tests. It provides \makeGlobalConfig\ and \makeProjectConfig\ helpers to construct valid Jest configuration objects with strict type checking, \alignedAnsiStyleSerializer\ for cleaner snapshot output, and conditional test runners (like \onNodeVersions\, \skipSuiteOnWindows\) to manage environment-specific test execution.
packages/test-utils · high confidence
New AgentReporter for AI coding agents
A new AgentReporter has been added to the reporters package. It is optimized for AI coding agents by reducing token usage, printing only failing tests and the final summary, and is automatically activated when an AI agent environment is detected via the AI\_AGENT environment variable.
packages/jest-reporters/src · high confidence
New JestEnvironment type definitions and API surface
The \packages/jest-environment/src/index.ts\ file introduces the core TypeScript definitions for Jest's test environment, including the \JestEnvironment\ class, \Jest\ interface, and related types like \EnvironmentContext\ and \InjectedModuleArguments\. This establishes the public API for test environments, exposing methods for timer manipulation (e.g., \advanceTimersByTime\, \advanceTimersToNextFrame\), mocking (\createMockFromModule\, \doMock\), and environment state (\isEnvironmentTornDown\, \getSeed\). It also defines the structure for module wrappers and import meta extensions (\JestImportMeta\), providing the type foundation for how Jest injects globals and handles module execution contexts.
packages/jest-environment/src · high confidence
New abstract JSDOM environment package for custom implementations
Introduces the \@jest/environment-jsdom-abstract\ package, providing a \BaseJSDOMEnvironment\ class that developers can extend to create custom JSDOM-based test environments. This base implementation handles the core setup and teardown of the JSDOM instance, including console output forwarding (supporting both JSDOM 26's \sendTo\ and 27's \forwardTo\ APIs), fake timer initialization, and global object configuration, allowing users to focus on specific environment customizations without reimplementing the underlying JSDOM mechanics.
packages/jest-environment-jsdom-abstract · high confidence
New interactive watch mode plugins for failing tests and snapshots
Jest now includes new watch mode plugins that allow you to interactively re-run failing tests or update failing snapshots without leaving the terminal. The new FailedTestsInteractivePlugin (key 'i') lets you select and re-run specific failed tests, while the UpdateSnapshotsInteractivePlugin (key 'i') provides an interactive interface to selectively update snapshot failures. These plugins are part of a broader refactor that also introduces dedicated plugins for quitting (QuitPlugin), filtering by test name (TestNamePatternPlugin), filtering by file path (TestPathPatternPlugin), and bulk updating snapshots (UpdateSnapshotsPlugin).
packages/jest-core/src/plugins · high confidence
New package for generating Jest transform cache keys
A new \jest-create-cache-key-function\ package has been added, providing a utility to generate cache keys for Jest transform functions. The exported \createCacheKey\ function accepts an array of file paths, an array of string values, and an optional key length (defaulting to 32 characters, or 16 on Windows), and returns a function that produces a SHA-1 based cache key. This key incorporates environment variables (NODE\_ENV, BABEL\_ENV), file contents, source text, relative file paths, instrumentation status, configuration strings, and caller support flags (such as ESM capabilities) to ensure cache validity across different environments and transform options.
packages/jest-create-cache-key-function/src · high confidence
New regex utility functions for escaping and normalizing paths and strings
The \jest-regex-util\ package now exports three new functions: \escapePathForRegex\, \escapeStrForRegex\, and \replacePathSepForRegex\. These utilities help safely construct regular expressions from file paths and strings by handling platform-specific path separators (converting backslashes to forward slashes on Windows) and escaping special regex characters. This allows users to reliably match file paths or strings in regex patterns without issues caused by unescaped metacharacters or OS-specific path formats.
packages/jest-regex-util/src · high confidence
Website now supports auto-formatting and archives old documentation versions
Developers using VS Code will now have code automatically formatted on save via a new \.vscode/settings.json\ configuration. Additionally, the website now includes an \archivedVersions.json\ file that provides direct links to the documentation for older Jest versions (22.x through 29.6), ensuring users can still access historical guides even as the main site updates.
website · high confidence
jest-mock package initialization with TypeScript and ESM support
The \packages/jest-mock/src\ directory now contains the source code for the \jest-mock\ package, marking its migration to TypeScript and ESM. This entry introduces the core mock implementation, including types for \Mock\, \MockInstance\, \SpiedFunction\, and \MockedObject\, as well as the \Mock\ interface extending \Disposable\ for explicit resource management. Users gain access to a robust, type-safe mocking API with features like \withImplementation\, \mockImplementationOnce\, and support for async generators and property spying, all built on a modern TypeScript foundation.
packages/jest-mock/src · high confidence
Removals
Removal of CoffeeScript example files
The CoffeeScript example directory has been cleaned up in preparation for version 0.9.0. This change removes the example source code (sum.coffee), the custom preprocessor (preprocessor.js), and the associated test files (sum-test.coffee and sum-test.js) that previously demonstrated how to use CoffeeScript with the tooling.
examples/coffeescript · high confidence
Removal of jQuery-based fetchCurrentUser example
The tutorial example demonstrating user fetching via jQuery has been removed. This eliminates the specific code pattern using jQuery's AJAX method and its deprecated \done\ callback for retrieving current user data.
examples/tutorial · high confidence
Removal of legacy Jasmine 1.3 test runner implementation
The legacy Jasmine 1.3 test runner files (\JasmineReporter.js\ and \jasmineTestRunner.js\) have been removed from the \src/jasmineTestRunner\ directory. This deletion eliminates the previous implementation that relied on the \q\ promise library, required the \--harmony\ flag for WeakMap support, and used specific Jasmine 1.3 vendor code. Users relying on this specific runner configuration will no longer have access to these legacy components, which were responsible for reporting test results and setting up the Jasmine environment with custom matchers and object comparison logic.
src/jasmineTestRunner · high confidence
Removal of legacy bin/jest.js CLI entry point
The \bin/jest.js\ file, which served as the command-line interface for running tests, has been deleted. This change removes the direct execution path that previously handled argument parsing via \optimist\, configuration loading from \package.json\, and test execution via the \TestRunner\. Users relying on this specific binary script will need to use the updated entry points or module interfaces provided by the new structure.
bin · high confidence
Removal of legacy coverage and test runner components
The legacy \CoverageCollector\, \JSDomEnvironment\, \TestRunner\, \TestWorker\, \coverageTemplate\, and \defaultTestResultHandler\ modules have been removed from the source code. This cleanup eliminates the previous implementation of code coverage instrumentation, the custom JS DOM environment setup, and the original test execution and reporting logic, indicating a shift to a new underlying architecture for these features.
src · high confidence
Removal of legacy internal modules
The \FakeTimers\, \colors\, \jsdom-compat\, \moduleMocker\, and \utils\ modules have been removed from \src/lib\. This cleanup eliminates internal implementation details and legacy compatibility hacks, such as the custom colorization logic and jsdom workarounds, as the project transitions to using external libraries like Chalk for colorization and updated jsdom versions.
src/lib · high confidence
Removal of manual\_mocks example
The manual\_mocks example file (FileSummarizer.js) has been removed from the examples directory. This eliminates a legacy example that demonstrated manual mocking using synchronous file system operations, simplifying the available examples for users.
_examples/manual\mocks · high confidence
Removal of the legacy HasteModuleLoader
The legacy HasteModuleLoader implementation and its associated test suite have been removed from the codebase. This change eliminates the old module resolution and loading logic, which relied on the \node-haste\ library and the \Q\ promise library, in favor of the newer \node-haste2\ resolver architecture.
src/HasteModuleLoader · high confidence
Removed manual fs mock example
The manual mock example for the 'fs' module has been removed from the examples directory. This deletion eliminates the custom implementation that allowed tests to mock filesystem operations via a \\_\_setMockFiles\ helper, simplifying the example set by removing this specific mocking pattern.
_examples/manual\mocks/\\mocks\\_ · high confidence_
Removed sum example from getting\_started
The 'sum' example file has been removed from the getting\_started directory, eliminating this specific introductory code snippet from the project's examples.
_examples/getting\started · high confidence
Removed vendor Jasmine 1.3.0 library
The vendored Jasmine 1.3.0 testing library has been removed from the project. This deletion eliminates the previous version of the BDD framework, which will require tests to be updated to use the new testing infrastructure or library version.
vendor · high confidence
Architecture
Extract Immutable.js utilities into a dedicated module
The equality-checking logic for Immutable.js data structures (such as Lists, Sets, OrderedMaps, and Records) has been moved from the main utility files into a new \immutableUtils.ts\ module. This change isolates the detection of Immutable.js objects using their internal sentinels, keeping the core equality logic in \jasmineUtils.ts\ and \utils.ts\ cleaner and more focused on standard JavaScript types.
packages/expect-utils/src · high confidence
Extract fake timers into a dedicated package with modern and legacy implementations
The fake timers logic has been extracted from the core Jest packages into a new standalone \jest-fake-timers\ package. This package exposes two distinct implementations: \ModernFakeTimers\, which is backed by \@sinonjs/fake-timers\ and supports advanced features like \Temporal\ time mocking and async timer APIs, and \LegacyFakeTimers\, which provides the original timer mocking behavior. This separation allows for cleaner dependency management and enables the use of the modern, more robust fake timer engine while maintaining backward compatibility for existing tests.
packages/jest-fake-timers/src · high confidence
Jest runtime internals refactored into modular components
The monolithic Jest runtime class has been decomposed into a set of specialized internal modules (CjsExportsCache, CjsLoader, EsmLoader, JestGlobals, MockState, ModuleExecutor, ModuleRegistries, Resolution, TestMainModule, TestState, and TransformCache). This architectural change isolates responsibilities such as CommonJS and ESM loading, module mocking, global injection, and file caching, which improves maintainability and allows for more precise handling of module resolution and execution states.
packages/jest-runtime/src/internals · high confidence
New private package for Jest global type declarations
A new private package, \@jest/test-globals\, has been introduced to centralize TypeScript type declarations for Jest's global test APIs (such as \describe\, \it\, \expect\, and \jest\). This package re-exports types from \@jest/environment\, \@jest/expect\, \@jest/types\, and \jest-mock\ to provide consistent typing for the global scope within the Jest repository itself, including support for the new \Spied\*\ utility types.
packages/test-globals · high confidence
Behavioural changes
Build system migrated to native ESM and Webpack bundling
The build scripts have been rewritten as native ESM modules (\.mjs\) and now use Webpack to bundle Jest packages. This change introduces a new \babel-plugin-jest-native-globals\ to ensure internal modules use unmodified globals like \Promise\ and \Symbol\, and adds a \bundleTs\ script using \@microsoft/api-extractor\ to generate consolidated TypeScript definition files. The build process now automatically generates ESM entry points (\.mjs\) alongside CommonJS files and validates package exports and TypeScript references during the build.
scripts · high confidence
CLI entry point migrated to TypeScript with project filtering support
The CLI entry point in \packages/jest-core/src/cli/index.ts\ has been rewritten in TypeScript, introducing explicit type imports (e.g., from \@jest/console\, \@jest/test-result\, \@jest/types\) and replacing legacy \require\ calls with modern ES module imports (e.g., \exit-x\, \graceful-fs\, \chalk\). This change enables the CLI to accept \--selectProjects\ and \--ignoreProjects\ arguments, allowing users to filter which projects are executed during a test run. The implementation also integrates performance markers around key lifecycle events like \runCLI\ and \getChangedFiles\, and uses \pluralize\ from \jest-util\ for more accurate user-facing messages regarding open handles.
packages/jest-core/src/cli · high confidence
Expect library migrated to TypeScript and restructured into modular source files
The \packages/expect/src\ codebase has been rewritten in TypeScript and split into distinct modules (asymmetricMatchers, matchers, spyMatchers, toThrowMatchers, jestMatchersObject, types, etc.). This migration introduces strict typing for matchers and context, enables new capabilities such as custom equality testers and support for async functions in \toBe\, and refactors internal state management and error reporting logic while preserving the existing public API surface.
packages/expect/src · high confidence
File watching in jest-haste-map is replaced with @parcel/watcher
The file-watching implementation in \jest-haste-map\ has been refactored to use \@parcel/watcher\ instead of the previous native watchers (such as \NodeWatcher\ and \FSEventsWatcher\). This change introduces a new \ParcelWatcher\ class that leverages \@parcel/watcher\'s platform-specific backends (like \fs-events\ on macOS, \inotify\ on Linux, and \windows\ on Windows) while retaining \WatchmanWatcher\ for users who explicitly opt in. The new architecture includes a \WatcherDriver\ to manage multiple roots, a \ChangeQueue\ to batch and deduplicate file events, and improved error handling for transient issues like \EPERM\ on Windows or subscription failures. Tests have been added to cover the new \ChangeQueue\, \ParcelWatcher\, and \WatchmanWatcher\ components.
packages/jest-haste-map/src/watchers · high confidence
Improved object serialization and diffing for complex types
The matcher utilities now handle complex object structures more robustly during error reporting. A new \Replaceable\ class and \deepCyclicCopyReplaceable\ function allow for deep copying of Maps, Arrays, and Objects while preserving prototypes and handling self-referential getters to prevent infinite recursion. Additionally, the system now respects a \SERIALIZABLE\_PROPERTIES\ symbol on objects, allowing users to customize which properties are included in the diff output, and correctly iterates over both string and symbol keys when comparing objects.
packages/jest-matcher-utils/src · high confidence
Improved variable hoisting and error reporting in jest.mock factories
The babel-plugin-jest-hoist now provides more precise handling of variables within jest.mock factory functions. It correctly hoists pure constant variables and imports of jest from @jest/globals, while explicitly ignoring TypeScript type queries to prevent false positives. Additionally, the plugin now throws detailed, user-friendly errors when disallowed out-of-scope variables are referenced, listing the specific allowed identifiers to help developers fix their mocks quickly.
packages/babel-plugin-jest-hoist/src · high confidence
Inline snapshot formatting now preserves empty lines and supports Prettier 3
When Jest writes inline snapshots, it now preserves empty lines within the snapshot content rather than stripping them, and it correctly handles indentation for multiline snapshots. Additionally, the snapshot system now supports Prettier 3 by offloading formatting to a worker thread via synckit, ensuring compatibility with the latest Prettier versions while maintaining backward compatibility with Prettier 2.
packages/jest-snapshot/src · high confidence
Interactive failure runs and improved open handle detection
Jest now supports interactive failure runs in watch mode, allowing you to iteratively fix failing tests one by one using a new \FailedTestsInteractiveMode\ UI that lets you skip, restart, or quit the process. The \--detectOpenHandles\ flag has been significantly improved to reduce false positives by ignoring specific internal Node.js resources (such as \PROMISE\, \TLSWRAP\, \DNSCHANNEL\, and \CustomGC\) and using \WeakRef\ to more accurately track resource lifecycles.
packages/jest-core/src · high confidence
Introduce JSDOM environment implementation via abstract base class
The JSDOM test environment is now implemented as a concrete class extending \@jest/environment-jsdom-abstract\. This change centralizes the core environment logic in the abstract base package, allowing the JSDOM-specific package to simply pass the JSDOM library and configuration to the base implementation. Users benefit from a more modular architecture where environment behavior is defined in the abstract layer, while this package handles the specific integration with the JSDOM library.
packages/jest-environment-jsdom/src · high confidence
Jasmine 2 test runner rewritten in TypeScript with improved error reporting
The \jest-jasmine2\ test runner has been migrated from JavaScript to TypeScript, introducing a new \ExpectationFailed\ error class and a dedicated \assertionErrorMessage\ module that formats assertion failures with clearer, human-readable operator descriptions (e.g., 'to deeply equal') and structured diffs. The migration also adds a \PCancelable\ utility for managing cancellable promises and a \jestExpect\ adapter that bridges Jest's modern \expect\ API with the Jasmine interface, ensuring consistent matcher behavior across both testing styles.
packages/jest-jasmine2/src · high confidence
Jasmine runtime core rewritten in TypeScript
The \jest-jasmine2\ test runner's internal Jasmine implementation has been migrated from JavaScript to TypeScript. This change introduces new, strictly typed source files (such as \Env.ts\, \Spec.ts\, \Suite.ts\, and \CallTracker.ts\) that replace the previous JavaScript logic, providing better type safety and maintainability for the test execution engine without altering the external API.
packages/jest-jasmine2/src/jasmine · high confidence
Jest CLI is rewritten in TypeScript with new programmatic exports
The \jest-cli\ package source has been migrated from JavaScript to TypeScript, introducing new entry points in \packages/jest-cli/src\. This change exposes \run\ and \buildArgv\ functions, as well as \yargsOptions\, allowing users to programmatically invoke Jest or access its CLI argument definitions. The CLI argument validation logic is now centralized in \args.ts\, and the runtime now uses \exit-x\ for process termination instead of the native \process.exit\.
packages/jest-cli/src · high confidence
Jest CLI now uses import-local to ensure local installation is used
The Jest CLI entry point has been updated to check for a locally installed version of Jest before falling back to a global installation. This ensures that when running tests, the project's specific version of Jest is used rather than a potentially different global version, preventing version mismatch issues.
packages/jest/bin · high confidence
Jest CLI now uses import-local to support global installations
The Jest CLI binary has been updated to use the \import-local\ module, which ensures that when Jest is invoked globally, it runs the local project's version of Jest rather than the globally installed one. This change also sets the \NODE\_ENV\ environment variable to 'test' if it is not already defined, ensuring consistent behavior for test runs.
packages/jest-cli/bin · high confidence
Jest configuration system restructured with new TypeScript support and renamed options
The configuration handling in \jest-config\ has been reorganized into dedicated modules (\Defaults\, \Deprecated\, \ValidConfig\, \Descriptions\) to improve maintainability and validation. TypeScript configuration files (\.ts\, \.mts\, \.cts\) are now supported with native Node.js support and fallback to loaders like \ts-node\. Several configuration options have been renamed: \extraGlobals\ is now \sandboxInjectedGlobals\, \moduleLoader\ is now \runtime\, and \testURL\ is replaced by \testEnvironmentOptions.url\. Deprecated options like \browser\, \scriptPreprocessor\, and \setupTestFrameworkScriptFile\ now provide clear migration messages. The default test environment is set to \jest-environment-node\, and the default coverage provider is \babel\.
packages/jest-config/src · high confidence
Jest now uses a custom source-map implementation backed by @jridgewell/trace-mapping
Jest replaces the external \source-map-support\ library with a Jest-owned implementation in the new \@jest/source-map\ package. This change improves source-map handling by caching parsed maps for the lifetime of the worker process to reduce overhead, and specifically fixes a bug where absolute Windows paths (e.g., \C:input.ts\) were incorrectly treated as relative URLs, ensuring stack traces display correct file locations on Windows.
packages/jest-source-map/src · high confidence
Jest package restructure and new configuration exports
The main entry point for the Jest package has been restructured to consolidate exports from core, CLI, and config modules. Users can now import \defineConfig\ and \mergeConfig\ directly from the main package for easier configuration management, alongside existing exports like \runCLI\ and \run\. Additionally, specific TypeScript types (\Config\, \GlobalConfig\, \ProjectConfig\) are now explicitly re-exported from the main entry point, improving type availability for consumers.
packages/jest/src · high confidence
Jest resolver rewritten to use unrs-resolver for improved performance
The \jest-resolve\ package has been completely rewritten in TypeScript and now delegates the core module resolution logic to the \unrs-resolver\ (unrs) library, replacing the previous \resolve\ and \jest-pnp-resolver\ dependencies. This architectural shift introduces a new caching strategy for resolver factories to minimize NAPI overhead and adds a benchmark suite (\\_\benchmarks\\_/test.js\) to measure resolution costs. For users, this results in significantly faster module resolution times, particularly in large projects, while maintaining compatibility with existing configuration options like \conditions\, \extensions\, and \moduleDirectory\. The change also includes updated error handling via a new \ModuleNotFoundError\ class and improved support for Node.js features such as the \node:\ prefix and \--preserve-symlinks\.
packages/jest-resolve/src · high confidence
Jest runner rewritten in TypeScript with event-driven architecture and ESM support
The \jest-runner\ package has been completely rewritten in TypeScript and converted to ESM, introducing a new event-driven architecture via the \EmittingTestRunner\ class that emits \test-file-start\, \test-file-success\, and \test-file-failure\ events, replacing the previous callback-based model. This change brings stricter typing for test contexts and runners, supports ESM test environments and transformers, and improves worker management with features like \workerIdleMemoryLimit\ for recycling workers on memory leaks and \workerGracefulExitTimeout\ for graceful shutdowns. The runner now uses \p-limit\ for concurrency control, integrates with \jest-worker\ for parallel execution, and exposes detailed test lifecycle events for better integration with external tools and watch mode.
packages/jest-runner/src · high confidence
Jest runtime performance optimization and benchmarking infrastructure
This change introduces a dedicated benchmark suite for the Jest runtime to measure and track the performance impact of module loading (both CJS and ESM) and refactors the runtime internals to reduce per-require overhead. The new \\_\benchmarks\\_/test.js\ script allows developers to measure the cost of loading a binary tree of modules, providing a baseline for performance improvements. Concurrently, the runtime source code (\src/index.ts\, \src/helpers.ts\) has been restructured to optimize module resolution and execution, specifically targeting the reduction of overhead in the module loading path, as evidenced by the benchmark results showing a 5-6% improvement in CJS and 2-3% in ESM loading times.
packages/jest-runtime/src · high confidence
Leak detector now uses FinalizationRegistry and V8 heap snapshots for more accurate memory leak detection
The Jest leak detector has been rewritten in TypeScript and now leverages the native FinalizationRegistry API to track object lifecycle, removing the previous reliance on the external weak-napi dependency. Additionally, the detector can now generate V8 heap snapshots to provide more aggressive and accurate garbage collection checks when a potential leak is detected, while also ensuring primitives are correctly rejected with descriptive error messages.
packages/jest-leak-detector/src · high confidence
Migrate React examples to modern function components and Babel 7
The React examples have been updated to use modern JavaScript and React patterns. The legacy \preprocessor.js\ using \react-tools\ has been replaced by a \babelrc.js\ configuration that uses \@babel/preset-env\ and \@babel/preset-react\ with the automatic runtime. Component code, such as \CheckboxWithLabel\, has been converted from ES5 \React.createClass\ syntax to ES6 function components using hooks (e.g., \useState\). Additionally, a \setupTests.js\ file has been added to configure the React testing environment.
examples/react · high confidence
Migrate jQuery examples to ES6+ syntax and Babel 7
The jQuery examples have been updated to use modern JavaScript syntax, including arrow functions, const/let declarations, and template literals, replacing the previous var and string concatenation style. This change is supported by the addition of a Babel 7 configuration file (.babelrc.js) using @babel/preset-env, ensuring the examples are transpiled correctly. Additionally, the code has been cleaned up by standardizing the AJAX callback handling and updating copyright headers to Meta Platforms.
examples/jquery · high confidence
Migrate jest-resolve-dependencies to TypeScript and ESM
The \jest-resolve-dependencies\ package source has been rewritten in TypeScript and migrated to ESM, replacing the previous CommonJS implementation. This change introduces the \DependencyResolver\ class with methods to resolve direct dependencies, inverse dependencies, and mock dependencies, while also adding a mock file for testing purposes.
packages/jest-resolve-dependencies/src · high confidence
Migrate timer example to Babel 7 and modernize syntax
The timer example now uses Babel 7 with the @babel/preset-env preset, replacing the previous configuration. Additionally, the JavaScript code has been updated to use ES6 arrow functions for setTimeout callbacks and numeric separators (e.g., 10\_000) for integer literals, improving code readability and consistency with modern standards.
examples/timer · high confidence
Migration of diff-sequences to TypeScript
The \diff-sequences\ package source code has been migrated from JavaScript to TypeScript. This change introduces strict type definitions for the algorithm's internal structures, such as \IsCommon\ and \FoundSubsequence\ callbacks, \Indexes\, and \Division\, ensuring type safety for the Myers diff algorithm implementation while maintaining the same public API and behavioral output for users.
packages/diff-sequences/src · high confidence
New @jest/transform package with TypeScript type stripping and improved error handling
The \@jest/transform\ package has been extracted and rewritten in TypeScript, introducing a new \ScriptTransformer\ that automatically strips TypeScript type annotations from \.ts\/\.mts\/\.cts\ files when no other transformer claims them (using Node's native \stripTypeScriptTypes\ when available). The package also provides enhanced syntax error messages for unexpected tokens, improved validation for transformer return values and source maps, and a dedicated \shouldInstrument\ utility for coverage decisions. This change includes a new \.npmignore\ to exclude source and test files from the published package, and exports types like \TransformerFactory\ and \TransformedSource\ for custom transformer development.
packages/jest-transform · high confidence
New ESLint plugin with TypeScript and built-in rule aliases
A new ESLint plugin has been added at .eslintplugin/index.mjs that exposes specific rules for use in the project's linting configuration. The plugin re-exports the 'no-restricted-types' rule from the typescript-eslint package and aliases two built-in ESLint rules, 'prefer-rest-params' and 'prefer-spread', under 'eventually' suffixed names. This allows the project to centrally manage these specific linting behaviors.
.eslintplugin · high confidence
Node environment now mirrors all global properties and handles lazy globals
The Node.js test environment has been rewritten to automatically detect and expose all available global properties from the underlying Node runtime, rather than relying on a hardcoded list. This ensures that new or less common globals (such as TextEncoder, TextDecoder, AbortController, and structuredClone) are available in tests without requiring explicit additions. The implementation also introduces a proxy-based approach to handle 'lazy' globals (like built-in modules in newer Node versions) to prevent them from being eagerly loaded and triggering deprecation warnings during environment setup, while specifically guarding against warnings from localStorage access when the --localstorage-file flag is not set.
packages/jest-environment-node/src · high confidence
Refactor jest-core internal utilities and improve JSON serialization
This change reorganizes the internal implementation of jest-core by extracting several helper functions into the new \packages/jest-core/src/lib\ directory, including modules for managing active filter messages, creating test contexts, handling deprecation warnings, validating file paths, logging debug messages, updating global configuration, and sorting watch plugin usage. Additionally, it introduces a new \serializeToJSON\ utility that ensures Errors and BigInt values are serialized correctly when using the \--json\ flag, preventing data loss or formatting issues in JSON output.
packages/jest-core/src/lib · high confidence
Refactored file crawling into modular Node and Watchman implementations
The file crawling logic in jest-haste-map has been restructured from a monolithic class into separate, dedicated modules for Node-based and Watchman-based crawling. This change introduces a unified \crawl\ entry point that automatically selects the appropriate crawler and implements a fallback mechanism: if the Watchman crawler fails (e.g., because Watchman is not running), it automatically retries using the Node crawler. The Node crawler now uses the \fdir\ library for directory traversal and \graceful-fs\ for file system operations, while the Watchman crawler includes improved error handling by attaching error listeners before use to prevent unhandled exceptions.
packages/jest-haste-map/src/crawlers · high confidence
Reworked @jest/util package structure and utilities
The @jest/util package has been restructured with a new public API surface, including a new isError helper for cross-realm error detection, a requireOrImportModule utility for unified CJS/ESM loading, and garbage-collection utilities (protectProperties, deleteProperties) to manage global object lifecycles. The globsToMatcher function now uses picomatch instead of micromatch for improved glob matching performance and correctness. Additionally, the package now includes a .npmignore file to exclude test and source files from published artifacts, and a Readme.md documenting the available utility functions.
packages/jest-util · high confidence
Standardize getting-started example with Babel 7 and updated licensing
The getting-started example has been updated to use Babel 7 by introducing a .babelrc.js configuration file that applies the @babel/preset-env preset. Additionally, the example files (sum.js and sum.test.js) now include copyright notices for Meta Platforms, Inc. and affiliates, and the test suite has been added to verify the sum function's behavior.
examples/getting-started · high confidence
Update React snapshot example to use modern React patterns
The snapshot example has been updated to use React function components with hooks (useState, useEffect) instead of class components, and the Babel configuration now uses the React automatic runtime. This aligns the example with current React best practices and simplifies the component structure for users learning snapshot testing.
examples/snapshot · high confidence
Update manual-mocks example with Babel 7 and Node.js protocol imports
The manual-mocks example has been updated to use Babel 7 by adding a .babelrc.js configuration file with the @babel/preset-env preset. Additionally, the example code now uses the 'node:' protocol for built-in module imports (e.g., 'node:fs') and includes updated copyright headers for Meta Platforms.
examples/manual-mocks · high confidence
Updated module-mock example to use Babel 7 and modern mocking APIs
The module-mock example has been migrated to use Babel 7 via a new \.babelrc.js\ configuration, enabling modern JavaScript syntax support. The example code now demonstrates partial mocking using \jest.createMockFromModule\ instead of the deprecated \genMockFromModule\, and utilizes \jest.requireActual\ for accessing original module implementations. Additionally, the example files have been updated with Meta Platforms copyright notices and standardized folder structures.
examples/module-mock · high confidence
babel-jest migrated to TypeScript with new configuration options and async support
The babel-jest package source has been rewritten in TypeScript, introducing the \excludeJestPreset\ configuration option to allow users to opt out of the default \babel-preset-jest\ and supporting async transformations. The cache key generation now includes the Node.js version and uses SHA-1 hashing, while the transformer explicitly exports \createTransformer\ and the \TransformerConfig\ interface for external use.
packages/babel-jest/src · high confidence
jest-circus rewritten in TypeScript with describe-level retries and improved error handling
The \jest-circus\ test runner has been rewritten in TypeScript, introducing several behavioral changes for users. Most notably, it adds describe-level retries, allowing entire \describe\ blocks to be re-run on failure with configurable options like \retryImmediately\ and \waitBeforeRetry\. The runner now better handles unhandled promise rejections by waiting for the next event loop turn to ensure errors are captured, preventing false test failures. Additionally, Node.js \assert\ errors are now formatted with detailed diffs and human-readable operator names, and the test execution order for \describe\ blocks can be randomized via a seed.
packages/jest-circus/src · high confidence
jest-diff rewritten in TypeScript with new formatting options
The \jest-diff\ package source has been migrated from JavaScript to TypeScript, introducing a new \DiffOptions\ interface that allows users to customize diff output. This includes options to control colors and symbols (e.g., \aColor\, \bColor\, \changeColor\), display change counts (\includeChangeCounts\), sort object keys (\compareKeys\), and handle trailing spaces (\changeLineTrailingSpaceColor\). The diff engine now also escapes non-printable control characters in string comparisons to make them visible in test output.
packages/jest-diff/src · high confidence
jest-docblock migrated to TypeScript
The \jest-docblock\ package source has been rewritten in TypeScript, introducing explicit type definitions for the \Pragmas\ record and function signatures. This change improves type safety and developer experience for consumers of the library while maintaining the existing public API for extracting, parsing, and printing JavaScript docblocks.
packages/jest-docblock/src · high confidence
jest-each refactored into TypeScript with improved validation and concurrent test support
The \jest-each\ package has been rewritten in TypeScript and split into modular files (\bind.ts\, \index.ts\, \validation.ts\). This change introduces stricter validation for table data, including better error messages for missing arguments and invalid heading formats, and adds support for \concurrent\ tests via \test.concurrent\ and \it.concurrent\. The implementation now uses \ReadonlyArray\ types for table data and supports passing functions to \describe\ and \it/test\ again, while also relaxing validation to allow multibyte characters in headings.
packages/jest-each/src · high confidence
jest-each: support object templates and improved placeholder handling
The table processing logic in jest-each has been refactored to support new interpolation patterns. Users can now pass object templates to it.each, allowing titles to reference object properties using dot-notation (e.g., \${user.name}\). The system also introduces a new \\#$\ placeholder to insert the test case index into titles. Additionally, the \%j\ placeholder now correctly serializes BigInt values and handles cyclic objects by rendering them as \\[Circular\]\, preventing runtime errors that previously occurred with these data types.
packages/jest-each/src/table · high confidence
jest-haste-map internals refactored into modular TypeScript with improved file-watching reliability
The internal implementation of jest-haste-map has been restructured into separate TypeScript modules (CacheManager, FileProcessor, WorkerPool, walk, etc.) to improve maintainability and performance. This change introduces a new file-walking engine using the \fdir\ library, which replaces the previous walker and hand-rolled traversal logic, resulting in more efficient directory crawling. Additionally, the cache system now uses Node's \v8\ module for serialization, and the file indexing process has been hardened to tolerate locked files on Windows (specifically \EPERM\ errors) and gracefully handle file access errors without aborting the entire crawl. The worker pool management has also been refined to ensure proper cleanup when builds are aborted.
packages/jest-haste-map/src/lib · high confidence
jest-haste-map source code is rewritten in TypeScript
The \jest-haste-map\ package source files (including \HasteFS\, \ModuleMap\, \index\, \types\, and \worker\) have been migrated from JavaScript to TypeScript. This change introduces strict type definitions for the internal data structures (such as \FileMetaData\ and \ModuleMapData\) and the public interfaces (\IHasteFS\, \IModuleMap\), which improves code reliability and provides better type support for consumers of the package.
packages/jest-haste-map/src · high confidence
jest-watcher package migrated to TypeScript
The \jest-watcher\ package has been converted from JavaScript to TypeScript, introducing a full suite of new source files including \BaseWatchPlugin\, \JestHooks\, \PatternPrompt\, \TestWatcher\, and the \Prompt\ class, along with supporting utilities for scrolling, pattern formatting, and colorization. This migration includes the addition of a \.npmignore\ file to exclude source and test artifacts from the published package, a \tsconfig.json\ to manage compilation and project references, and a comprehensive set of unit tests and snapshot tests to verify the behavior of the prompt and formatting logic.
packages/jest-validate, packages/jest-watcher · high confidence
jest-worker rewritten in TypeScript with new task scheduling and type safety
The \jest-worker\ package has been rewritten in TypeScript, introducing a new \JestWorkerFarm\ helper type for improved type inference and stricter typing for worker methods. The internal task scheduling logic has been refactored to support a new \PriorityQueue\ alongside the existing \FifoQueue\, allowing tasks to be processed by computed priority. Additionally, the package now includes a \CLAUDE.md\ file for agent documentation, a \.npmignore\ file to exclude source and test files from the published package, and a new \start()\ method to eagerly initialize workers.
packages/jest-worker · high confidence
Test coverage
Add multi-project Babel end-to-end tests with Flow transpilation; Add test fixtures for virtual mock isolation; Add type tests and documentation for @jest/types; Added Jest snapshot tests for diff-sequences common substring logic; Added Node.js 18 and 20+ test suites for babel-plugin-jest-hoist; Added TypeScript and React working samples with tests; Added argument validation and config extension tests for jest-cli; Added benchmark for Haste Map removal performance; Added comprehensive test coverage for jest-circus execution and error handling; Added comprehensive test coverage for jest-snapshot internals; Added e2e test fixture for multiple transformers; Added e2e test fixtures for node path resolution and custom instrumenting preprocessor; Added e2e tests for test path patterns in subprojects; Added manual mocking examples for file summarization, lodash, user models, and environment detection; Added mock file structure for jest-resolve tests; Added mock resolver fixtures for testing; Added mock runtime factory for testing; Added property-based and unit tests for diff-sequences; Added snapshot test fixture for related module resolution; Added snapshot tests for Clock and Link components; Added snapshot tests for Clock and Link examples using @testing-library/react; Added snapshot tests for HasteMap duplicate module and crawl error handling; Added snapshot tests for Jest reporters; Added snapshot tests for React Native example components; Added snapshot tests for expectation result factory; Added snapshot tests for fake timers warning messages; Added snapshot tests for jest-circus execution order and hook behavior; Added snapshot tests for jest-config normalization and deprecation warnings; Added snapshot tests for jest-each validation errors; Added snapshot tests for jest-matcher-utils diffing and error reporting; Added snapshot tests for primitive leak detection; Added snapshot tests for snapshot resolver and matcher error reporting; Added test coverage for Jest reporters; Added test coverage for class mocking, mock function routing, and window spying; Added test coverage for jest-each array and template modes; Added test coverage for jest-resolve core components; Added test coverage for jest-runtime core behaviors; Added test fixtures for custom snapshot resolver validation; Added test fixtures for custom snapshot serializers; Added test fixtures for jest-resolve-dependencies; Added test fixtures for mocked dependencies in jest-resolve-dependencies; Added test suite for jest-diff; Added tests for @jest/console CustomConsole and BufferedConsole; Added tests for @jest/globals import restrictions; Added tests for CheckboxWithLabel component; Added tests for JSDomEnvironment configuration and teardown behavior; Added tests for NodeEnvironment globals cleanup and lazy global handling; Added tests for async user data retrieval; Added tests for babel-jest cache key generation and transformer behavior; Added tests for error message formatting and cause handling; Added tests for expect-utils utility functions; Added tests for jest-config module utilities and configuration handling; Added tests for jest-core core components and interactive modes; Added tests for jest-create-cache-key-function; Added tests for jest-docblock parsing and extraction; Added tests for jest-haste-map core components; Added tests for jest-matcher-utils internal utilities; Added tests for legacy and modern fake timer implementations; Added tests for replacePathSepForRegex; Added tests for test collection and assertion error handling in jest-circus; Added tests for the FailedTestsInteractive plugin; Added tests for the create-jest initializer; Added tests for the dependency resolver; Added tests for the jest-source-map package; Added type tests for @jest/expect package; Added type tests for @jest/reporters utilities; Added type tests for Jest config exports; Added type tests for jest-resolve exports; Added type tests for jest-runner; Added type tests for jest-snapshot SnapshotResolver and matchers; Added type tests for the \isA\ utility in \@jest/expect-utils\; Added type tests for the expect package using TSTyche; Added unit tests for Jest core library utilities; Added unit tests for Jest leak detector; Added unit tests for jest-haste-map core components; Expanded test coverage for the expect package; Migrated jQuery example tests to modern Jest syntax; New e2e test infrastructure and regression snapshots; New test utilities for jest-circus event handling; Removed FileSummarizer manual mock test; Removed legacy Jest test for the sum example; Removed tests for TestRunner.findTestsRelatedTo; Snapshot test for debug message logging added; Updated CheckboxWithLabel test to use modern React testing patterns; Updated snapshot tests for error message formatting; Updated test snapshots for the expect package; Updated timer example tests to use modern Jest APIs; jest-diff: Added snapshot tests for diff output formatting.
Dependencies
Routine dependency and lockfile maintenance
This update performs routine maintenance on the project's dependency manifests and lockfiles. It includes updates to various development dependencies such as ESLint plugins, Prettier, TypeScript, and Docusaurus, alongside general lockfile refreshes to resolve conflicts and ensure consistency across the monorepo. No new product features or behavioral changes are introduced by this change.
(dependencies) · high confidence
Yarn 4.18.0 release and dependency patches
The project now uses Yarn 4.18.0 (replacing the previous version in .yarn/releases). Additionally, patches have been added for @types-mdx (to import JSX from React), lru-cache (to remove the Map implementation from its type declaration), and ts-node (to hardcode the Node16 ModuleKind value).
.yarn · high confidence
Housekeeping
Jest v30.5.2 release; pretty-format package structure and documentation.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 44 → 46 (+1.9)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.16) — scores are not directly comparable.
Lenses
- Code Health 71 → 65 (-6.2)
- Architecture 45 (new)
- Maturity 73 → 62 (-11.2)
- Readiness 25 → 36 (+10.7)
- Security 54 → 74 (+19.8)
- Performance 60 (new)
Resolved (47)
- ADR not followed: Supporting Jest Open Source (website/blog/2018-06-27-supporting-jest-open-source.md)
- Boundary-crossing change coupling: Descriptions.ts ↔ Config.ts (packages/jest-config/src/Descriptions.ts)
- Boundary-crossing change coupling: ValidConfig.ts ↔ config.ts (packages/jest-config/src/ValidConfig.ts)
- Boundary-crossing change coupling: args.ts ↔ index.ts (packages/jest-cli/src/args.ts)
- Boundary-crossing change coupling: args.ts ↔ normalize.ts (packages/jest-cli/src/args.ts)
- Boundary-crossing change coupling: index.ts ↔ config.ts (packages/jest-config/src/index.ts)
- Boundary-crossing change coupling: normalize.ts ↔ config.ts (packages/jest-config/src/normalize.ts)
- Change coupling: Defaults.ts ↔ ValidConfig.ts (packages/jest-config/src/Defaults.ts)
- Change coupling: Defaults.ts ↔ normalize.ts (packages/jest-config/src/Defaults.ts)
- Change coupling: ValidConfig.ts ↔ normalize.ts (packages/jest-config/src/ValidConfig.ts)
- Change coupling: eventHandler.ts ↔ state.ts (packages/jest-circus/src/eventHandler.ts)
- Dimension evaluation failed
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (e2e/native-esm/yarn.lock)
- High CVE: [GHSA redacted] (e2e/native-esm/yarn.lock)
- High CVE: [GHSA redacted] (e2e/native-esm/yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 27 more
New (799)
- AsymmetricMatcher.serialize (cognitive 17) (packages/pretty-format/src/plugins/AsymmetricMatcher.ts)
- Boundary-crossing change coupling: CoverageWorker.ts ↔ testWorker.ts (packages/jest-reporters/src/CoverageWorker.ts)
- Change coupling: CoverageReporter.ts ↔ generateEmptyCoverage.ts (packages/jest-reporters/src/CoverageReporter.ts)
- Change coupling: ValidConfig.ts ↔ index.ts (packages/jest-config/src/ValidConfig.ts)
- Change coupling: index.ts ↔ config.ts (packages/jest-config/src/index.ts)
- Change coupling: normalize.ts ↔ config.ts (packages/jest-config/src/normalize.ts)
- CjsExportsCache.getExportsOf (cognitive 29) (packages/jest-runtime/src/internals/CjsExportsCache.ts)
- CjsLoader.requireModule (cognitive 23) (packages/jest-runtime/src/internals/CjsLoader.ts)
- CjsLoader.requireModule (cyclomatic 25) (packages/jest-runtime/src/internals/CjsLoader.ts)
- ClassTooLong: Resolver (packages/jest-resolve/src/resolver.ts)
- ClassTooLong: Runtime (packages/jest-runtime/src/index.ts)
- ClassTooLong: matchers (packages/expect/src/matchers.ts)
- Coverage not measured — JavaScript/TypeScript suite
- CoverageReporter._addUntestedFiles (cognitive 27) (packages/jest-reporters/src/CoverageReporter.ts)
- CoverageReporter._addUntestedFiles (cyclomatic 21) (packages/jest-reporters/src/CoverageReporter.ts)
- CoverageReporter._checkThreshold (cognitive 61) (packages/jest-reporters/src/CoverageReporter.ts)
- CoverageReporter._checkThreshold (cyclomatic 31) (packages/jest-reporters/src/CoverageReporter.ts)
- CoverageReporter._getCoverageResult (cognitive 19) (packages/jest-reporters/src/CoverageReporter.ts)
- Env.jasmineEnv (cognitive 30) (packages/jest-jasmine2/src/jasmine/Env.ts)
- Env.jasmineEnv (cyclomatic 50) (packages/jest-jasmine2/src/jasmine/Env.ts)
- …and 779 more
Changes since last survey
- 100 commits — 54 feature/other, 46 fixes
By area
- (root) — 18 commits
- packages/jest-runtime — 15 commits
- packages/jest-haste-map — 9 commits
- packages/jest-resolve — 8 commits
- website/versioned_docs — 5 commits
- e2e/transform — 4 commits
- packages/jest-snapshot — 4 commits
- e2e/tests — 3 commits
- packages/jest-circus — 3 commits
- packages/jest-reporters — 3 commits
- .github/copilot-instructions.md — 2 commits
- .github/workflows — 2 commits
- packages/jest-source-map — 2 commits
- packages/jest-util — 2 commits
- packages/pretty-format — 2 commits
- .github/renovate.json — 1 commit
- e2e/Utils.ts — 1 commit
- e2e/bigint — 1 commit
- e2e/collect-tests — 1 commit
- e2e/custom-resolver-esm — 1 commit
Notable commits
- fix: [jest-circus, jest-jasmine2] Fix error-handler restore, --expand for assert diffs, and generator test context (#16347)
- fix: fix(@jest/transform): key transform caches on the caller support flags (#16331)
- fix: fix(cjs-esm-interop): support module.exports in ESM (#16277)
- fix: fix(jest-config): add missing options to ValidConfig to prevent spurious warnings (#16224)
- fix: fix(jest-config): only warn about global-only options where they're actually ignored (#16411)
- fix: fix(jest-console): buffer console output in CustomConsole for reporters (#16155)
- fix: fix(jest-core): do not report CustomGC as an open handle (#16379)
- fix: fix(jest-each): escape table keys before building the interpolation RegExp (#16345)
- fix: fix(jest-each): serialize bigint values in %j titles (#16338)
- fix: fix(jest-haste-map): attach the watchman client's error listener before use (#16355)
- fix: fix(jest-haste-map): end the worker farm when the build aborts synchronously (#16354)
- fix: fix(jest-haste-map): keep a duplicated mock name alive when its file goes (#16360)
- fix: fix(jest-haste-map): restore the nested duplicates index in ModuleMap.fromJSON (#16353)
- fix: fix(jest-haste-map): tighten the cache key and the watched-extension match (#16352)
- fix: fix(jest-haste-map): tolerate a locked file while indexing on Windows (#16358)
- fix: fix(jest-haste-map): tolerate transient EPERM in the watcher lstat (#16295)
- fix: fix(jest-message-util): print inner errors of AggregateError test failures (#16316)
- fix: fix(jest-resolve): apply moduleNameMapper to both spellings of core modules (#16390)
- fix: fix(jest-resolve): build and cache data: URI module IDs the same way sync and async (#16370)
- fix: fix(jest-resolve): isolate virtual mock module IDs (#16296)
- …and 80 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
jestjs/jest was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 202dd8a14777c270607c2416bd5034c3c0abc984 — the exact code this score is about.
- Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-eb9197011364.