pretty-format
30.5.1 · 1 Sep 2026MIT304.4M / weekRepositoryHomepagenpmAtom feed
24.9.0 is the newest release of 24.x.
In short
23 breaking42 new1 faster59 fixed38 internal
- breaking
jest-each: Add primitive pretty printing for interpolated titles
- breaking
jest-diff: Support diffing numbers and booleans instead of returning null for different ones
- breaking
jest-diff: Replace
diffwithdiff-sequencespackage - breaking
jest-cli: Only set error process error codes when they are non-zero
- breaking
jest-config: Deprecate
setupTestFrameworkScriptFilein favor of newsetupFilesAfterEnv - breaking
jest-worker: Add functionality to call a
setupmethod in the worker before the first call and ateardownmethod when ending the farm - breaking
jest-config: Set default
notifyModetofailure-change - breaking
jest-haste-map: Remove support for
@providesModule
Release note
Features
- breaking
jest-each: Add primitive pretty printing for interpolated titles
jest-runtime: Add
jest.isolateModulesfor scoped module initialization- breaking
jest-diff: Support diffing numbers and booleans instead of returning null for different ones
- breaking
jest-diff: Replace
diffwithdiff-sequencespackage - breaking
jest-cli: Only set error process error codes when they are non-zero
- breaking
jest-config: Deprecate
setupTestFrameworkScriptFilein favor of newsetupFilesAfterEnv - breaking
jest-worker: Add functionality to call a
setupmethod in the worker before the first call and ateardownmethod when ending the farm - breaking
jest-config: Set default
notifyModetofailure-change - breaking
jest-haste-map: Remove support for
@providesModule - breaking
jest-haste-map: Replace internal data structures to improve performance
- breaking
jest-haste-map: Use relative paths to allow remote caching
- breaking
jest-haste-map: Remove name from hash in
HasteMap.getCacheFilePath - breaking
babel-preset-jest: Export a function instead of an object for Babel 7 compatibility
- breaking
jest-haste-map: Expose relative paths when getting the file iterator
- breaking
jest-cli: Run code transforms over
global{Setup,Teardown} jest-haste-map: Add
hasteFS.getSize(path)jest-cli: Print version ending in
-devwhen running a local Jest clonejest-cli: Add Support for
globalSetupandglobalTeardownin projectsjest-runtime: Add
extraGlobalsto config to load extra global variables into the execution vmjest-util: Export
specialCharscontaining Unicode characters and ANSI escapes for console outputjest-config: Handle typescript (
tsandtsx) by defaultjest-validate: Add support for comments in
package.jsonusing a"//"keyjest-config: Add shorthand for watch plugins and runners
jest-jasmine2/jest-circus/jest-cli: Add test.todo
pretty-format: Option to not escape strings in diff messages
jest-haste-map: Add
getFileIteratortoHasteFSfor faster file iterationjest-config: Add
readConfigsfunction, previously injest-clijest-snapshot: Enable configurable snapshot paths
pretty-format: Support HTMLCollection and NodeList in DOMCollection plugin
jest-runtime: Pass the normalized configuration to script transformers
expect: Improve report when assertion fails, part 3
jest-runtime: If
requirefails without a file extension, print all files that match with onejest-haste-map: Make
ignorePatternoptionaljest-haste-map: Add
getCacheFilePathto get the path to the cache file for aHasteMapinstancejest-runtime: Remove
cacheDirectoryfromignorePatternforHasteMapif not necessaryjest-validate: Add syntax to validate multiple permitted types
jest-config: Accept an array as as well as a string for
testRegex([#7209]#7209))expect/jest-matcher-utils: Improve report when assertion fails, part 4
expect/jest-matcher-utils: Improve report when assertion fails, part 5
expect: Check constructor equality in .toStrictEqual()
jest-util: Add
jest.getTimerCount()to get the count of scheduled fake timersjest-config: Add
dependencyExtractoroption to use a custom module to extract dependencies from files (#7313, #7349, #7350, #7362)jest-haste-map: Accept a
getCacheKeymethod inhasteImplModulePathmodules to reset the cache when the logic changesjest-config: Add
haste.computeSha1option to compute the sha-1 of the files in the haste mapexpect:
expect(Infinity).toBeCloseTo(Infinity)TreatsInfinityas equal in toBeCloseTo matcherjest-worker: Add node worker-thread support to jest-worker
jest-config: Allow
bailsetting to be configured with a number allowing tests to abort afternof failuresjest-config: Allow % based configuration of
--max-workersjest-runner: Instantiate the test environment class with the current
testPathjest-config: Always resolve jest-environment-jsdom from jest-config
expect: Improve report when assertion fails, part 6
jest-worker: Add
enableWorkerThreadsoption to explicitly opt-in toworker_threadsif available
Fixes
expect: Accept inherited properties in
toHavePropertymatcherjest-diff: Do not claim that
-0and0have no visual differencejest-mock: Fix automock for numeric function names
jest-config: Ensure
existsSyncis only called with a string parameterexpect:
toStrictEqualconsiders sparseness of arrays.jest-cli: Fix empty coverage data for untested files
- breaking
jest-cli: Do not use
text-summarycoverage reporter by default if other reporters are configured - breaking
jest-mock: Fix bugs with mock/spy result tracking of recursive functions
- breaking
jest-haste-map: Recover files correctly after haste name collisions are fixed
- breaking
pretty-format: Omit non-enumerable symbol properties
- breaking
*: Upgrade to Babel 7, dropping support for Babel 6
jest-cli: Avoid watch mode causing bad terminal behavior in some cases
jest-runner/jest-worker: Fix missing console output in verbose mode
expect: Standardize file naming in
expectjest-each: Add empty array validation check
jest-cli: Interrupt tests if interactive watch plugin key is pressed
jest-each: Add each array validation check
jest-haste-map: Do not visit again files with the same sha-1
jest-jasmine2: Fix memory leak in Error objects hold by the framework
jest-haste-map: Fixed Haste whitelist generation for scoped modules on Windows
jest-mock: Fix inheritance of static properties and methods in mocks
jest-mock: Fix mocking objects without
Object.prototypein their prototype chainjest-mock: Check
_isMockFunctionis true rather than truthy on potential mocksjest-cli: Update jest-cli to show git ref in message when using
changedSince[jest-jasmine2] Fix crash when test return Promise rejected with nulljest-runtime: Check
_isMockFunctionis true rather than truthy on potential global mocksjest-jasmine: Show proper error message from async
asserterrorsjest-jasmine2: Better error message when a describe block is empty
jest-jasmine2: Pending calls inside async tests are reported as pending not failed
jest-circus: Better error message when a describe block is empty
jest-jasmine2: Add missing testLocationResults for
xitandfitexpect: Return false from asymmetric matchers if received value isn’t string
jest-cli: Fix unhandled error when a bad revision is provided to
changedSincejest-config: Moved dynamically assigned
cwdfromjest-clito default configuration injest-configjest-config: Fix
getMaxWorkerson termuxjest-runtime: Throw an explicit error if
jsis missing frommoduleFileExtensionsjest-runtime: Fix missing coverage when using negative glob pattern in
testMatch*: Ensure
maxWorkersis at least 1 (was 0 in some cases where there was only 1 CPU)jest-runtime: Fix transform cache invalidation when requiring a test file from multiple projects
jest-changed-files: Return correctly the changed files when using
lastCommit=trueon Mercurial repositoriesbabel-jest: Cache includes babel environment variables
jest-config: Use strings instead of
RegExpinstances in normalized configurationjest-circus: Make sure to display real duration even if time is mocked
expect: Improves the failing message for
toStrictEqualmatcher.expect: Improves the failing message for
toEqualmatcher.jest-resolve: Fix not being able to resolve path to mapped file with custom platform
jest-message-util: Improve parsing of error messages for unusually formatted stack traces
jest-runtime: Ensure error message text is not lost on errors with code frames
jest-haste-map: Fix to resolve path that is start with words same as rootDir
expect: Fix toMatchObject matcher when used with
Object.create(null)jest-haste-map: Remove legacy condition for duplicate module detection
jest-haste-map: Fix
requiredetection with trailing commas and ignoreimport typeofmodulesjest-cli: Fix to set prettierPath via config file
expect: Test more precisely for class instance getters
jest-cli: Support dashed args
jest-cli: Fix to run in band tests if watch mode enable when runInBand arg used
jest-runtime: Fix mistake as test files when run coverage issue.
jest-cli: Print info about passWithNoTests flag
pretty-format: Omit unnecessary symbol filter for object keys
jest-runtime: Fix
requireActualon node_modules with mock presentjest-resolve: Fix
isBuiltinModuleto support versions of node withoutmodule.builtinModulesbabel-jest: Set
cwdto be resilient to it changing during the runtime of the testsjest-snapshot: Write and read snapshots from disk even if
fsis mockedjest-config: Normalize
config.cwdandconfig.rootDirusing `realpathjest-environment-node: Fix buffer property is not ArrayBuffer issue.
babel-plugin-jest-hoist: Ignore TS type annotations when looking for out-of-scope references
jest-config: Add name to project if one does not exist to pick correct resolver
jest-runtime: Pass
watchPathIgnorePatternsto Haste instancejest-runtime: Resolve mock files via Haste when using
require.resolve
Chore & Maintenance
- breaking
*: Require Node.js 6+ for all packages
- breaking
jest-util: Remove long-deprecated globals for fake timers
- breaking
*: Upgrade to Micromatch 3
- breaking
*: Remove regenerator-runtime injection
Performance
jest-mock: Improve
getTypefunction performance.