jest-util
30.5.1 · 1 Sep 2026MIT156.2M / weekRepositoryHomepagenpmAtom feed
23.4.0 is the newest release of 23.x.
In short
7 breaking49 new30 fixed12 internal
- breaking
jest-snapshot: Concatenate name of test, optional snapshot name and count
- breaking
jest-jasmine2: Adds error throwing and descriptive errors to
it/testfor invalid arguments.[jest-circus]Adds error throwing and descriptive errors toit/testfor invalid arguments - breaking
jest-mock: Include tracked call results in serialized mock
- breaking
jest-mock: Replace timestamps with
invocationCallOrder - breaking
pretty-format: Remove undefined props from React elements
- breaking
babel-jest: Always return object from transformer
- breaking
jest-runtime: Remove
jest.genMockFnandjest.genMockFunction
Release note
Features
expect: Expose
getObjectSubset,iterableEquality, andsubsetEqualityjest-snapshot: Add snapshot property matchers
jest-config: Support jest-preset.js files within Node modules
jest-cli: Add
--detectOpenHandlesflag which enables Jest to potentially track down handles keeping it open after tests are complete.jest-jasmine2: Add data driven testing based on
jest-eachjest-matcher-utils: Change "suggest to equal" message to be more advisory
jest-message-util: Don't ignore messages with
vendoranymorejest-validate: Get rid of
jest-configdependencyjest-validate: Adds option to inject
deprecationEntries- breaking
jest-snapshot: Concatenate name of test, optional snapshot name and count
jest-runtime: Allow for transform plugins to skip the definition process method if createTransformer method was defined.
expect: Add stack trace for async errors
jest-jasmine2: Add stack trace for timeouts
jest-jasmine2: Add stack trace for thrown non-
Errorsjest-runtime: Prevent modules from marking themselves as their own parent
jest-mock: Add support for auto-mocking generator functions
expect: Add support for async matchers
expect: Suggest toContainEqual
jest-config: Export Jest's default options
jest-editor-support: Move
coveragetoProjectWorkspace.collectCoveragejest-editor-support: Add
coverageoption to runnerjest-haste-map: Support extracting dynamic
importsexpect: Improve output format for mismatchedArgs in mock/spy calls.
jest-cli: Add support for using
--coveragein combination with watch mode,--onlyChanged,--findRelatedTestsand more- breaking
jest-jasmine2: Adds error throwing and descriptive errors to
it/testfor invalid arguments.[jest-circus]Adds error throwing and descriptive errors toit/testfor invalid arguments jest-matcher-utils: Add
isNotoption tomatcherHintfunctionjest-config: Add
<rootDir>to runtime files not found error reportexpect: Make toThrow matcher pass only if Error object is returned from promises
expect: Add isError to utils
expect: Add inverse matchers (
expect.not.arrayContaining, etc., #5517)expect:
expect.extendnow also extends asymmetric matchersjest-mock: Update
spyOnPropertyto support spying on the prototype chainjest-mock: Add tracking of return values in the
mockpropertyjest-mock: Add tracking of thrown errors in the
mockpropertyAdd nthCalledWith spy matcher
jest-cli: Add
isSerialproperty that runners can expose to specify that they can not run in parallelexpect: Add
.toBeCalledTimesandtoHaveBeenNthCalledWithaliasesjest-cli: Interactive Snapshot Mode improvements
jest-editor-support: Add
no-coloroption to runnerjest-jasmine2: Pretty-print non-Error object errors
jest-message-util: Include column in stack frames
expect: Introduce toStrictEqual
expect: Add return matchers
jest-cli: Improve snapshot summaries
expect: Include custom mock names in error messages
jest-diff: Support returning diff from oneline strings
expect: Improve return matchers
jest-cli: Overhaul watch plugin hooks names
- breaking
jest-mock: Include tracked call results in serialized mock
Fixes
jest-cli: Fix stdin encoding to utf8 for watch plugins.
expect: Better detection of DOM Nodes for equality
jest-cli: Fix misleading action description for F key when in "only failed tests" mode.
jest-worker: Stick calls to workers before processing them
babel-plugin-jest-hoist: Allow using
consoleglobal variablejest-jasmine2: Always remove node core message from assert stack traces
expect: Add stack trace when
expect.assertionsandexpect.hasAssertionscauses test failures.jest-runtime: Throw a more useful error when trying to require modules after the test environment is torn down
- breaking
jest-mock: Replace timestamps with
invocationCallOrder jest-jasmine2: Install
sourcemap-supportinto normal runtime to catch runtime errorsjest-jasmine2: Added assertion error handling inside
afterAll hookjest-cli: Remove the notifier actions in case of failure when not in watch mode.
jest-mock: Extend .toHaveBeenCalled return message with outcome
jest-runner: Assign
process.env.JEST_WORKER_ID="1"when in runInBand modejest-cli: Add descriptive error message when trying to use
globalSetup/globalTeardownfile that doesn't export a function.expect: Do not rely on
instanceof RegExp, since it will not work for RegExps created inside of a different VMjest-resolve: Update node module resolution algorithm to correctly handle symlinked paths
jest-editor-support: Update
Settingsto use spawn in shell optionjest-cli: Improve the error message when 2 projects resolve to the same config
jest-runtime: Remove retainLines from coverage instrumentation
jest-cli: Fix update snapshot issue when using watchAll
expect: Fix rejects.not matcher
jest-runtime: Prevent Babel warnings on large files
jest-mock: Prevent
mockRejectedValuefrom causing unhandled rejectionpretty-format: Handle React fragments better
pretty-format: Handle formatting of
React.forwardRefandContextcomponentsjest-cli: Switch collectCoverageFrom back to a string
jest-regex-util: Fix handling regex symbols in tests path on Windows
jest-util: Fix handling of NaN/Infinity in mock timer delay
jest-resolve: Generalise test for package main entries equivalent to ".".
jest-config: Ensure that custom resolvers are used when resolving the configuration
website: Fix website docs
expect: Fix isEqual Set and Map to compare object values and keys regardless of order
- breaking
pretty-format: Remove undefined props from React elements
jest-haste-map: Properly resolve mocked node modules without package.json defined
Chore & Maintenance
- breaking
babel-jest: Always return object from transformer
- breaking
jest-runtime: Remove
jest.genMockFnandjest.genMockFunction