@jest/transform
30.5.2 · 18 Sep 2026MIT80.4M / weekRepositoryHomepagenpmAtom feed
100 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 27.x
27.4.2
30 Nov 2021jest-worker: Add additional
execArgvto filter
27.4.1
30 Nov 2021jest-worker: Filter
execArgvcorrectly
27.4.0
29 Nov 2021expect: Enhancing the
toHavePropertymatcher to support array selectionjest-core: Add support for
testResultsProcessorwritten in ESMjest-diff, pretty-format: Add
compareKeysoption for custom sorting of object keys
Features
expect: Enhancing the
toHavePropertymatcher to support array selectionjest-core: Add support for
testResultsProcessorwritten in ESMjest-diff, pretty-format: Add
compareKeysoption for custom sorting of object keysjest-mock: Add
ts-jestmock util functions
Fixes
expect: Allow again
expect.Matchersgeneric with single valuejest-circus, jest-jasmine2: Avoid false concurrent test failures due to unhandled promise rejections
jest-config: Add missing
slashdependency topackage.jsonjest-core: Incorrect detection of open ZLIB handles
jest-diff: Break dependency cycle
jest-environment-jsdom: Add
@types/jsdomdependencyjest-environment-jsdom: Do not reset the global.document too early on teardown
jest-transform: Improve error and warning messages
jest-worker: Pass
execArgvcorrectly toworker_threadsworker
27.3.1
19 Oct 2021expect: Make
expectextension propertiesconfigurableexpect: Fix
.any()checks on primitive wrapper classes
Fixes
expect: Make
expectextension propertiesconfigurableexpect: Fix
.any()checks on primitive wrapper classes
27.3.0
17 Oct 2021jest-config: Add
testEnvironmentOptions.htmlto apply to jsdom inputjest-resolver: Support default export (
.) inexportsfield ifmainis missingexpect: Tweak and improve types
Features
jest-config: Add
testEnvironmentOptions.htmlto apply to jsdom inputjest-resolver: Support default export (
.) inexportsfield ifmainis missing
Fixes
expect: Tweak and improve types
jest-runtime: Ensure absolute paths can be resolved within test modules
jest-runtime: Fix
instanceofforModernFakeTimersandLegacyFakeTimersmethods
27.2.5
8 Oct 2021- deprecated
@jest/types: Mark deprecated configuration options as
@deprecated jest-config: Warn when multiple Jest configs are located
Features
jest-config: Warn when multiple Jest configs are located
Fixes
expect: Pass matcher context to asymmetric matchers (#11926 & #11930)
expect: Improve TypeScript types
expect: Improve typings of
toThrow()andtoThrowError()matchersjest-cli: Improve
--helpprintout by removing defunct--browseroptionjest-haste-map: Use distinct cache paths for different values of
computeDependencies@jest/reporters: Do not buffer
console.logs when using verbose reporter
Chore & Maintenance
- deprecated
@jest/types: Mark deprecated configuration options as
@deprecated
27.2.4
29 Sep 2021expect: Add equality checks for Array Buffers in
expect.ToStrictEqual()jest-snapshot: Correctly indent inline snapshots
27.2.3
28 Sep 2021jest-config: Parse
testEnvironmentOptionsif received from CLIjest-reporters: Call
destroyonv8-to-istanbulconverters to free memory
Fixes
jest-config: Parse
testEnvironmentOptionsif received from CLIjest-reporters: Call
destroyonv8-to-istanbulconverters to free memory
27.2.2
25 Sep 2021jest-runtime: Correct
wrapperLengthvalue for ESM modules.
27.2.1
20 Sep 2021jest-transform: Improve the unexpected token error message.
jest-runtime: Fix regression when using
jest.isolateModulesand mocksjest-runtime: Include test name when importing modules after test has completed
Features
jest-transform: Improve the unexpected token error message.
Fixes
jest-runtime: Fix regression when using
jest.isolateModulesand mocksjest-runtime: Include test name when importing modules after test has completed
jest-runtime: Error when ESM import is used after test is torn down
27.2.0
13 Sep 2021jest-resolver, jest-runtime: Pass
conditionsto custom resolvers to enable them to implement support for package.jsonexportsfieldjest-runtime: Allow custom envs to specify
exportConditionswhich is passed together with Jest's own conditions to custom resolvers@jest/reporters: Use async transform if available to transform files with no coverage
Features
jest-resolver, jest-runtime: Pass
conditionsto custom resolvers to enable them to implement support for package.jsonexportsfieldjest-runtime: Allow custom envs to specify
exportConditionswhich is passed together with Jest's own conditions to custom resolvers
Fixes
@jest/reporters: Use async transform if available to transform files with no coverage
jest-util: Return correct value from
process.sendstub
27.1.1
8 Sep 2021jest-runtime: Add experimental, limited (and undocumented) support for mocking ECMAScript Modules
jest-resolver: Support
node:prefix when importing Node core modules with ESMjest-types: Export the
PrettyFormatOptionsinterface
27.1.0
27 Aug 2021jest-haste-map: Use watchman suffix-set option for faster file indexing.
jest-cli: Adds a new config options
snapshotFormatwhich offers a way to override any of the formatting settings which come with pretty-format.jest-reporters: Expose the
getSummaryutil (#11695).
Features
jest-haste-map: Use watchman suffix-set option for faster file indexing.
jest-cli: Adds a new config options
snapshotFormatwhich offers a way to override any of the formatting settings which come with pretty-format.jest-reporters: Expose the
getSummaryutil (#11695).jest-resolver: Support
node:prefix when importing Node core modules
Fixes
jest-each: Relaxed the validation to allow multibyte characters in headings
jest-environment-jsdom: Add support for
userAgentoptionjest-environment-node: Add
EventandEventTargetto node global environment.jest-mock: Fix
spyOnto useObject.prototype.hasOwnPropertyjest-resolver: Add dependency on
jest-haste-mapjest-types: Compat with
@types/nodev16
27.0.6
28 Jun 2021*: Publish all modules to include the build change
27.0.5
22 Jun 2021@jest/fake-timers: Flush callbacks scheduled with
requestAnimationFrameevery 16ms when using legacy timers.pretty-format: Use
globalThis(with polyfill if required) to bring support for esbuild's browser bundling mode (#11569jest-core: Support special characters like
@,+and()on Windows with--findRelatedTests
Features
@jest/fake-timers: Flush callbacks scheduled with
requestAnimationFrameevery 16ms when using legacy timers.pretty-format: Use
globalThis(with polyfill if required) to bring support for esbuild's browser bundling mode (#11569
Fixes
jest-core: Support special characters like
@,+and()on Windows with--findRelatedTests@jest/fake-timers: Do not add
setImmediateandclearImmediateif they do not exist in the global environment@jest/reporters: Allow
node-notifier@10as peer dependency@jest/reporters: Update
v8-to-istanbul
27.0.2
29 May 2021jest-circus: Add some APIs to make it easier to build your own test runner
jest-reporters: Expose the
getResultHeaderutiljest-resolver: Export
resolve*utils for different Jest modules
Features
jest-circus: Add some APIs to make it easier to build your own test runner
jest-reporters: Expose the
getResultHeaderutiljest-resolver: Export
resolve*utils for different Jest modules@jest/test-result: Export
Test,TestEventsandTestFileEvent
Fixes
jest-circus: Add missing
slashdependencyjest-circus, @jest/test-sequencer: Remove dependency on
jest-runnerjest-config: Resolve
config.runnerto absolute pathjest-config: Make sure to support functions as config
jest-core: Do not warn about
DNSCHANNELhandles when using the--detectOpenHandlesoptionjest-runner: Remove dependency on
jest-configjest-worker: Loosen engine requirement to
>= 10.13.0
27.0.1
25 May 2021jest-environment-jsdom: Bump version of JSDOM to avoid deprecated
requestpackage
27.0.0
25 May 2021- breaking
jest-circus: Fail tests when multiple
done()calls are made - breaking
jest-circus, jest-jasmine2: Fail the test instead of just warning when describe returns a value
- breaking
jest-config: Default to Node testing environment instead of browser (JSDOM)
Features
babel-jest: Add async transformation
jest-changed-files: Use '--' to separate paths from revisions
- breaking
jest-circus: Fail tests when multiple
done()calls are made - breaking
jest-circus, jest-jasmine2: Fail the test instead of just warning when describe returns a value
- breaking
jest-config: Default to Node testing environment instead of browser (JSDOM)
- breaking
jest-config: Use
jest-circusas default test runner jest-config: Add support for
presetwritten in ESMjest-config, jest-runtime: Support ESM for files other than
.jsand.mjs- breaking
jest-config, jest-runtime: Use "modern" implementation as default for fake timers (#10874 & #11197)
[jest-configAllow passingforceNodeFilesystemAPIthrough tojest-haste-map- breaking
[jest-config, jest-haste-map, jest-resolve, jest-runner, jest-runtime, jest-test-sequencer, jest-transform, jest-types]Add custom HasteMap class implementation config option jest-core: Make
TestWatcherextendemitteryjest-core: Run failed tests interactively the same way we do with snapshots
jest-core: More
TestSequencermethods can be asyncjest-core: Add support for
testSequencerwritten in ESMjest-core: Add support for
globalSetupandglobalTeardownwritten in ESMjest-core: Add support for
watchPluginswritten in ESMjest-core: Add support for
runnerwritten in ESMjest-core: Add support for
reporterswritten in ESMjest-each: Add support for interpolation with object properties
jest-environment-node: Add AbortController to globals
@jest/fake-timers: Update to
@sinonjs/fake-timersto v7jest-haste-map: Handle injected scm clocks
jest-haste-map: Add
enableSymlinksconfiguration option to follow symlinks for test files- breaking
jest-repl, jest-runner: Run transforms over environment
jest-repl: Add support for
testEnvironmentwritten in ESM- breaking
jest-runner: Set exit code to 1 if test logs after teardown
- breaking
jest-runner: Run transforms over
runnner - breaking
jest-runner: Run transforms over
testRunnner jest-runner: Possibility to use ESM for test environment (11033)
jest-runner: Add support for
testRunnerwritten in ESMjest-runtime: Detect reexports from CJS as named exports in ESM
jest-runtime: Support for async code transformations (#11191 & #11220)
jest-reporters: Add static filepath property to all reporters
- breaking
jest-snapshot: Make prettier optional for inline snapshots - fall back to string replacement (#7792 & #11192)
- breaking
jest-snapshot: Run transforms over
snapshotResolver jest-transform: Pass config options defined in Jest's config to transformer's
processandgetCacheKeyfunctionsjest-transform: Add support for transformers written in ESM
- breaking
jest-transform: Do not export
ScriptTransformerclass, instead export the async functioncreateScriptTransformer jest-transform: Async code transformations
jest-transform: Support transpiled transformers
- breaking
jest-transform:
requireAndTranspileModulealways return aPromise, and the third parameter type is changed toRequireAndTranspileModuleOptionswhich acceptapplyInteropRequireDefaultoption - breaking
jest-transform:
createTranspilingRequirereturn function which return aPromisenow jest-util: Add requireOrImportModule for importing CJS or ESM
jest-util: Add
applyInteropRequireDefaultoption onrequireOrImportModulejest-watcher: Added support for clearing the line when
<C-u>is pressed in a watch mode pattern promptjest-worker: Add support for custom task queues and adds a
PriorityQueueimplementation.jest-worker: Add in-order scheduling policy to jest worker (10902)
pretty-format: Better print for sparse arrays (11326)
pretty-print: Add option
printBasicPrototypewhich determines whether or not the prototype should be printed for raw objects or arrays
Fixes
babel-plugin-jest-hoist: Add
__dirnameand__filenameto whitelisted globals- breaking
expect: Revise
expect.not.objectContaining()to be the inverse ofexpect.objectContaining(), as documented. - breaking
expect: Make
toContainmore strict with the received type (#10119 & #10929) - breaking
expect:
matcherResultonJestAssertionErrorare now strings rather than functions jest-circus: Fixed the issue of beforeAll & afterAll hooks getting executed even if it is inside a skipped
describeblock #10451jest-circus: Fix
testLocationon Windows when usingtest.eachjest-cli: Use testFailureExitCode when bailing from a failed test
jest-cli: Print custom error if error thrown from global hooks is not an error already
jest-cli: Allow running multiple "projects" from programmatic API
jest-cli: Fix missing collectCoverage after init
jest-cli, jest-config, jest-types: Move all default values into
jest-config- breaking
jest-config: Change default file extension order by moving json behind ts and tsx (10572)
jest-console:
console.dirnow respects the second argument correctlyjest-core: Don't report PerformanceObserver as open handle
jest-core: Use
WeakRefto hold timers when detecting open handlesjest-core: Correctly detect open handles that were created in test functions using
donecallbacksjest-core: Do not collect
RANDOMBYTESREQUESTas open handlesjest-core: Wait briefly for open handles to close before flagging them when using
--detectOpenHandles- breaking
jest-diff: Use only named exports
- breaking
jest-each: Ignore excess words in headings
jest-each: Support array index with template strings
jest-each: Interpolate
%%correctlyjest-each: Fix wrong interpolation when the value of array contains multiple
%- breaking
jest-environment: Drop support for
runScriptfor test environments jest-environment-jsdom: Use inner realm’s
ArrayBufferconstructor- breaking
jest-environment-jsdom: Remove Node globals
setImmediateandclearImmediate#11222 - breaking
jest-get-type: Convert to ES Module
- breaking
jest-globals: Disallow return values other than a
Promisefrom hooks and tests - breaking
jest-globals: Disallow mixing a done callback and returning a
Promisefrom hooks and tests jest-haste-map: Vendor
NodeWatcherfromsanejest-jasmine2: Fixed the issue of
beforeAll&afterAllhooks getting executed even if it is inside a skippeddescribeblock when it has childtestsmarked as eitheronlyortodo#10451jest-jasmine2: Fixed the issues of child
testsmarked withonlyortodogetting executed even if it is inside a skipped parentdescribeblock #10451jest-jasmine2: Wrap all test functions so they open handles that were created in test functions using
donecallbacks can be detectedjest-reporter: Handle empty files when reporting code coverage with V8
jest-resolve: Replace read-pkg-up with escalade package
jest-resolve: Disable
jest-pnp-resolverfor Yarn 2- breaking
jest-runtime: Do not inject
globalvariable into module wrapper - breaking
jest-runtime: Remove long-deprecated
jest.addMatchers,jest.resetModuleRegistry, andjest.runTimersToTime jest-runtime: Fix stack overflow and promise deadlock when importing mutual dependant ES module
jest-runtime: Prevent global module registry from leaking into
isolateModulesregistryjest-runtime: Refactor to prevent race condition when linking and evaluating ES Modules
jest-runtime: Throw correct error when attempting to load ESM via
requirejest-runtime: Do not cache modules that throw during evaluation
jest-transform: Show enhanced
SyntaxErrormessage for allSyntaxErrors- breaking
jest-transform: Refactor API to pass an options bag around rather than multiple boolean options
- breaking
jest-transform: Refactor API of transformers to pass an options bag rather than separate
configand other options jest-types: Fix
Config.tsprojectstypesjest-util: Replace micromatch with picomatch to fix issues with negated globs
jest-validate: Use
en-USlocale to avoid case conversion problems while validating CLI options on machines with some certain locales(e.g. Turkish) set as default locale.- breaking
jest-worker: Use named exports
jest-worker: Do not swallow errors during serialization
jest-worker: Handle
ERR_IPC_CHANNEL_CLOSEDerrors properly- breaking
pretty-format: Convert to ES Modules
pretty-format: Only call
hasAttributeif it's a functionpretty-format: Handle jsdom attributes properly
pretty-format: Import pretty-format using named imports
Chore & Maintenance
- breaking
*: Only support Node LTS releases and Node 15
- breaking
*: Add
exportsfield to allpackage.jsons - breaking
*: Remove deprecated
mapCoverage - breaking
babel-jest: Migrate to ESM
- breaking
jest, jest-core: Replace
TestSchedulerexport withcreateTestScheduler - breaking
jest-config: Remove
enabledTestsMapconfig, usefilterinstead - breaking
jest-console: Move
rootintoconfigand takeGlobalConfigas mandatory parameter forgetConsoleOutput - breaking
jest-haste-map: Migrate to ESM
- breaking
jest-haste-map: Remove support for deprecated option
ignorePatternas function - breaking
jest-jasmine2: Migrate to ESM
- breaking
jest-jasmine2: Remove unused options argument from
Envconstructor - breaking
jest-repl, jest-runtime: Move the
jest-runtimeCLI intojest-repl(#10016 & #10925) - breaking
jest-resolve: Migrate to ESM
- breaking
jest-resolve-dependencies: Migrate to ESM
- breaking
jest-mock: Migrate to ESM
- breaking
jest-reporters: Make
node-notifiera peer dependency - breaking
jest-resolve, jest-runtime: Use
Maps instead of objects for all cached resources - breaking
jest-runner: Migrate to ESM
- breaking
jest-runtime: Remove deprecated and unused
getSourceMapInfofrom Runtime - breaking
jest-transformer: Remove unused
isCoreModuleoption - breaking
jest-validate: Remove
recursiveBlacklistoption in favor of previously introducedrecursiveDenylist
Performance
jest-resolve: Cache reading and parsing of
package.jsonsjest-runtime, jest-transform: Share
cacheFSbetween runtime and transformerjest-runtime: Load
chalkonly once per workerjest-worker: Fix memory leak of previous task arguments while no new task is scheduled
- 26.x
26.6.2
2 Nov 2020jest-core: Add
findRelatedTestsandnonFlagArgsin allowed config options forupdateConfigAndRunin watch pluginsbabel-plugin-jest-hoist: Preserve order of hoisted mock nodes within containing block
babel-plugin-jest-hoist: Hoist pure constants to support experimental JSX transform in hoisted mocks
Features
jest-core: Add
findRelatedTestsandnonFlagArgsin allowed config options forupdateConfigAndRunin watch plugins
Fixes
babel-plugin-jest-hoist: Preserve order of hoisted mock nodes within containing block
babel-plugin-jest-hoist: Hoist pure constants to support experimental JSX transform in hoisted mocks
babel-preset-jest: Update
babel-preset-current-node-syntaxto support top level awaitexpect: Revert "Fix
objectContainingto work recursively into sub-objects (#10508)"jest-circus, jest-jasmine2: Don't assume
stackis always a stringjest-config: Fix bug introduced in watch mode by PR #10678
jest-config: Throw correct error for missing preset modules
jest-resolve-dependencies: Resolve mocks as dependencies
jest-runtime: Handle file URLs in dynamic imports
jest-runtime, babel-jest: Pass more ESM options to
@jest/transformjest-runtime: Properly inject
extraGlobalsinto the runtimejest-transform: Link to ESM docs on syntax errors
26.6.1
23 Oct 2020jest-runtime: Support named exports from CommonJS as named ES Module imports
jest-validate: Add support for
recursiveDenylistoption as an alternative torecursiveBlacklistexpect: Fix
objectContainingto work recursively into sub-objects
Features
jest-runtime: Support named exports from CommonJS as named ES Module imports
jest-validate: Add support for
recursiveDenylistoption as an alternative torecursiveBlacklist
Fixes
expect: Fix
objectContainingto work recursively into sub-objectsjest-cli, jest-core, jest-config, jest-types: Fix
--onlyFailuresflag to work in non-watch modejest-config: Fix for the
jest.config.tscompiler to not interfere withtsconfig.jsonfilesjest-message-util: Update to work properly with Node 15
jest-mock: Allow to mock methods in getters (TypeScript 3.9 export)
26.6.0
19 Oct 2020jest-cli, jest-config: Add support for the
jest.config.tsconfiguration filejest-config: Simplify transform RegExp
jest-fake-timers: Lazily instantiate mock timers
Features
jest-cli, jest-config: Add support for the
jest.config.tsconfiguration file
Fixes
jest-config: Simplify transform RegExp
jest-fake-timers: Lazily instantiate mock timers
jest-runtime:
require.mainis no longerundefinedwhen usingjest.resetModules@jest/types: Add missing values for
timers
26.5.2
6 Oct 2020*: Revert usage of Escalade and rollback Yargs to v15 as it breaks Node 13
jest-circus: Setup globals before emitting
setup, and include Jest globals in thesetuppayloadjest-mock: Fix typings for
mockResolvedValue,mockResolvedValueOnce,mockRejectedValueandmockRejectedValueOnce
26.5.0
5 Oct 2020jest-circus, jest-config, jest-runtime: Add new
injectGlobalsconfig and CLI option to disable injecting global variables into the runtimejest-each: Fixes
.eachtype to always be callablejest-runner: Add support for
moduleLoaders withdefaultexports
Features
jest-circus, jest-config, jest-runtime: Add new
injectGlobalsconfig and CLI option to disable injecting global variables into the runtimejest-each: Fixes
.eachtype to always be callablejest-runner: Add support for
moduleLoaders withdefaultexports@jest/create-cache-key-function: Added a new package for creating cache keys
Fixes
jest-circus, jest-jasmine2: Find correct location for
test.eachtestsjest-console: Add
Consoleconstructor toconsoleobjectjest-globals: Fix lifecycle hook function types
jest-runtime: Remove usage of
vm.compileFunctiondue to a performance issue
26.3.0
10 Aug 2020- breaking
jest-worker: Downgrade minimum node version to 10.13
jest-circus, jest-jasmine2: Include
failureDetailsproperty in test resultsjest-each, jest-jasmine, jest-circus: Add support for
.concurrent.each
Features
jest-circus, jest-jasmine2: Include
failureDetailsproperty in test resultsjest-each, jest-jasmine, jest-circus: Add support for
.concurrent.each
Fixes
jest-config: Add
.pnp.jstotransformIgnorePatternsdefaultsjest-leak-detector: Wait properly for GC runs due to changes in Node 14.7
- breaking
jest-worker: Downgrade minimum node version to 10.13
26.2.2
31 Jul 2020jest-cli: Use correct file name to override existing jest config on init
jest-haste-map: Properly detect support for native
find
26.2.1
30 Jul 2020jest-worker: Make sure to work with Node TS typings v12
26.2.0
30 Jul 2020[jest-core, jest-circus, jest-reporter, jest-runner]Added support for reporting individual test cases using jest-circus[jest-config, jest-reporter, jest-runner, jest-test-sequencer]AddslowTestThresholdconfiguration optionjest-haste-map: Watchman crawler now includes dotfiles
Features
[jest-core, jest-circus, jest-reporter, jest-runner]Added support for reporting individual test cases using jest-circus[jest-config, jest-reporter, jest-runner, jest-test-sequencer]AddslowTestThresholdconfiguration optionjest-haste-map: Watchman crawler now includes dotfiles
jest-worker: Added support for workers to send custom messages to parent in jest-worker
jest-worker: Support passing
resourceLimitspretty-format: Added support for serializing custom elements (web components)
Fixes
expect: Match symbols and bigints in
any()jest-changed-files: Use
git diffinstead ofgit logfor--changedSincejest-console: Add missing
console.timeLogfor compatibility with Nodejest-haste-map: Check
findbinary supports the-inameparameterjest-snapshot: Strip added indentation for inline error snapshots
26.1.0
23 Jun 2020jest-mock: Export
Mock,MockInstance,SpyInstancetypesjest-config: Support config files exporting (
async)functionsjest-cli, jest-core: Add
--selectProjectsCLI argument to filter test suites by project name
Features
jest-mock: Export
Mock,MockInstance,SpyInstancetypesjest-config: Support config files exporting (
async)functionsjest-cli, jest-core: Add
--selectProjectsCLI argument to filter test suites by project namejest-cli, jest-init: Add
coverageProvidertojest --initprompts
Fixes
jest-console:
getConsoleOutputto receive global stack trace config and use it to format stack tracejest-jasmine2: Stop adding
:after an error that has no messagejest-diff: Control no diff message color with
commonColorin diff optionsjest-snapshot: Fix TypeScript compilation
Performance
jest-core, jest-transform, jest-haste-map: Improve Jest startup time and test runtime, particularly when running with coverage, by caching micromatch and avoiding recreating RegExp instances
26.0.1
5 May 2020jest-circus: Backward compatibility for deprecated
DescribeBlock.teststo not break e.g. Detox reporter
26.0.0
4 May 2020- breaking
jest-environment-jsdom: Upgrade
jsdomto v16 - breaking
jest-circus: Fail tests if a test takes a done callback and have return values
- breaking
jest-circus: Throw a proper error if a test / hook is defined asynchronously
Features
- breaking
jest-environment-jsdom: Upgrade
jsdomto v16 @jest/fake-timers: Add possibility to use a modern implementation of fake timers, backed by
@sinonjs/fake-timersjest-runtime: Add
createMockFromModuleas an alias forgenMockFromModule
Fixes
babel-jest: Handle
nullbeing passed tocreateTransformer[jest-circus, jest-console, jest-jasmine2, jest-reporters, jest-util, pretty-format]Fix time durating formatting and consolidate time formatting code- breaking
jest-circus: Fail tests if a test takes a done callback and have return values
- breaking
jest-circus: Throw a proper error if a test / hook is defined asynchronously
jest-circus: Throw more descriptive error if hook is defined inside test
- breaking
jest-circus: Align execution order of tests to match
jasmine's top to bottom order - breaking
jest-config, jest-resolve: Remove support for
browserfield jest-haste-map: Stop reporting files as changed when they are only accessed
jest-resolve: Show relative path from root dir for
module not founderrorsjest-runtime: Fix absolute path moduleNameMapper + jest.mock bug
Chore & Maintenance
- breaking
*: TypeScript definitions requires a minimum of TypeScript v3.8
- breaking
*: Drop support for Node 8
- breaking
expect, jest-mock, pretty-format: Remove
build-es5from package - breaking
@jest/fake-timers, @jest/environment: Rename
LolexFakeTimerstoModernFakeTimers - breaking
jest-haste-map: Removed
providesModuleNodeModules - breaking
jest-runtime: Remove long-deprecated
require.requireActualandrequire.requireMockmethods
- 25.x
25.5.1
29 Apr 2020jest-haste-map: Add missing
@types/graceful-fsdependencyjest-runner: Correctly serialize
Setpassed to workerjest-runtime: Vary ESM cache by query
25.5.0
28 Apr 2020@jest/globals: New package so Jest's globals can be explicitly imported
jest-core: Show coverage of sources related to tests in changed files
jest-runtime: Populate
require.cache
Features
@jest/globals: New package so Jest's globals can be explicitly imported
jest-core: Show coverage of sources related to tests in changed files
jest-runtime: Populate
require.cache
Fixes
*: Use
graceful-fsdirectly in every package instead of relying onfsbeing monkey patchedexpect: Prints the Symbol name into the error message with a custom asymmetric matcher
jest-circus, jest-jasmine2: Support older version of
jest-runtime(#9903 & #9842)@jest/environment: Make sure not to reference Jest types
jest-message-util: Code frame printing should respect
--noStackTraceflagjest-runtime: Support importing CJS from ESM using
importstatementsjest-runtime: Support importing parallel dynamic
importsjest-transform: Improve source map handling when instrumenting transformed code
Performance
jest-resolve: Update
resolveto a version using nativerealpath, which is faster than the default JS implementationjest-resolve: Pass custom cached
realpathfunction toresolvejest-runtime: Add
teardownmethod to clear any caches when tests completejest-runtime: Do not pass files required internally through transformation when loading them
jest-runtime: Use
Maps instead of object literals as cache holders
25.4.0
19 Apr 2020expect: Support
async functions intoThrowjest-console: Add code frame to
console.errorandconsole.warn
expect: Support
async functions intoThrowjest-console: Add code frame to
console.errorandconsole.warnjest-runtime, jest-jasmine2, jest-circus: Experimental, limited ECMAScript Modules support (#9772 & #9842)
Fixes
expect: Restore support for passing functions to
toHaveLengthmatcherjest-changed-files:
--only-changedshould include staged filesjest-circus: Throw on nested test definitions
jest-each:
eachwill throw an error when called with too many argumentsjest-runner: Don't print warning to stdout when using
--json
25.3.0
8 Apr 2020babel-jest: Support passing
supportsDynamicImportandsupportsStaticESMbabel-preset-jest: Enable all syntax plugins not enabled by default that works on current version of Node
jest-circus: Enable writing async test event handlers
Features
babel-jest: Support passing
supportsDynamicImportandsupportsStaticESMbabel-preset-jest: Enable all syntax plugins not enabled by default that works on current version of Node
jest-circus: Enable writing async test event handlers
jest-runtime, @jest/transformer: Support passing
supportsDynamicImportandsupportsStaticESM
25.2.6
2 Apr 2020Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.
25.2.3
26 Mar 2020*: Verify all packages are properly downleveled for older versions of TypeScript
25.2.1
26 Mar 2020*: Downlevel TypeScript definitions files for compatibility with TS<3.8
25.2.0
25 Mar 2020- breaking
jest-haste-map: Remove
mapperoption jest-config: Support ESM config files with
.jsextension (#9573).jest-runtime: Override
module.createRequireto return a Jest-compatiblerequirefunction
Features
jest-config: Support ESM config files with
.jsextension (#9573).jest-runtime: Override
module.createRequireto return a Jest-compatiblerequirefunction- breaking
jest-haste-map: Remove
mapperoption *: Support array of paths for
moduleNameMapperaliasesjest-reporters: Adds ability to pass options to the istanbul-reporter through
coverageReportersjest-runtime: Require stack when a module cannot be resolved
jest-transform:
writeCacheFileno longer callsfsync
Fixes
expect: Handle readonly properties correctly
jest-cli: Set
coverageProvidercorrectly when provided in configjest-cli: Allow specifying
.cjsand.mjsconfig files by--configCLI optionjest-cli: Update yargs to fix CLI flag overriding
jest-config: Treat
setupFilesAfterEnvlikesetupFileswhen normalizing configs against presetsjest-config: Support
.mjsconfig files on Windows as welljest-config: Verify
rootDirand allrootsare directoriesjest-config: Ensure pattern of
replacePosixSepis a stringjest-haste-map: Fix crash on unix based systems without find
jest-jasmine2: Fix
--testNamePatternmatching withconcurrenttestsjest-matcher-utils: Fix diff highlight of symbol-keyed object.
@jest/reporters: Notifications should be fire&forget rather than having a timeout
jest-resolve: Fix module identity preservation with symlinks and browser field resolution
jest-resolve: Do not confuse directories with files
jest-resolve:
moduleNameMappershould take precedence over Node core modulesjest-runtime: Reset
isolateModulesif it failsjest-runtime: Yarn PnP errors displayed to the user
jest-snapshot: Downgrade semver to v6 to support node 8
jest-snapshot: Properly indent new snapshots in the presences of existing ones
jest-transform: Correct sourcemap behavior for transformed and instrumented code
jest-transform: Allow instrumentation of transformed files with weird file extensions
@jest/types: Make
ConfigGlobalsan interface to allow for declaration merging.pretty-format: Export
OldPlugintype
Performance
jest-haste-map: Reduce number of
lstatcalls in node crawler
25.1.0
22 Jan 2020- breaking
jest-config: Set default display name color based on runner
- breaking
jest-config: Support
.mjsconfig files - breaking
jest-diff: Export as ECMAScript module
Features
babel-plugin-jest-hoist: Show codeframe on static hoisting issues
babel-plugin-jest-hoist: Add
BigInttoALLOWED_IDENTIFIERSbabel-preset-jest: Add
@babel/plugin-syntax-bigintexpect: Add
BigIntsupport totoBeGreaterThan,toBeGreaterThanOrEqual,toBeLessThanandtoBeLessThanOrEqualexpect, jest-matcher-utils: Display change counts in annotation lines
expect, jest-snapshot: Support custom inline snapshot matchers
jest-config: Throw the full error message and stack when a Jest preset is missing a dependency
- breaking
jest-config: Set default display name color based on runner
jest-config: Merge preset globals with project globals
jest-config: Support
.cjsconfig files- breaking
jest-config: Support
.mjsconfig files jest-core: Support reporters as default exports
jest-core: Support
--findRelatedTestspaths case insensitivity on Windowsjest-diff: Add options for colors and symbols
- breaking
jest-diff: Export as ECMAScript module
jest-diff: Add
includeChangeCountsand renameIndicatoroptionsjest-diff: Add
changeColorandpatchColoroptionsjest-diff: Add
trailingSpaceFormatteroption and replace cyan withcommonColorjest-diff: Add
firstOrLastEmptyLineReplacementoption and export 3diffLinesfunctionsjest-environment: Add optional
getVmContextnext torunScript(#9252 & #9428)jest-environment-jsdom: Add
fakeTimersLolexjest-environment-node: Add
fakeTimersLolexjest-environment-node: Add
queueMicrotaskjest-environment-node: Implement
getVmContext(#9252 & #9428)@jest/fake-timers: Add Lolex as implementation of fake timers
jest-get-type: Add
BigIntsupport.jest-matcher-utils: Add
BigIntsupport toensureNumbersensureActualIsNumber,ensureExpectedIsNumberjest-matcher-utils: Ignore highlighting matched asymmetricMatcher in diffs
jest-reporters: Export utils for path formatting
jest-reporters: Provides global coverage thresholds as watermarks for istanbul
jest-runner: Warn if a worker had to be force exited
- breaking
jest-runtime: Do not export
ScriptTransformer- it can be imported from@jest/transforminstead jest-runtime: Use
JestEnvironment.getVmContextandvm.compileFunctionif available to avoid the module wrapper (#9252 & #9428)jest-snapshot: Display change counts in annotation lines
- breaking
jest-snapshot: Improve report when the matcher has properties
jest-snapshot: Improve colors when snapshots are updatable
jest-snapshot: Ignore indentation for most serialized objects
jest-transform: Create
createTranspilingRequirefunction for easy transpiling modules- breaking
jest-transform: Return transformed code as a string, do not wrap in
vm.Script @jest/test-result: Create method to create empty
TestResult- breaking
jest-worker: Return a promise from
end(), resolving with the information whether workers exited gracefully jest-reporters: Transform file paths into hyperlinks
Fixes
expect: Display
expectedDiffmore carefully intoBeCloseToexpect: Avoid incorrect difference for subset when
toMatchObjectfailsexpect: Consider all RegExp flags for equality
- breaking
expect: Consider primitives different from wrappers instantiated with
new expect: Prevent maintaining RegExp state between multiple tests
expect: Fix subsetEquality false circular reference detection
jest-config: Use half of the available cores when
watchAllmode is enabledjest-config: Fix Jest multi project runner still cannot handle exactly one project
jest-console: Add missing
console.groupcalls toNullConsolejest-core: Don't include unref'd timers in --detectOpenHandles results
jest-core: Limit number of workers when creating haste maps in projects
jest-diff: Do not inverse format if line consists of one change
jest-diff: Rename some new options and change their default values
jest-environment-node: Fix
TextEncoder.encodenot referencing same globalUint8Arrayconstructorjest-fake-timers:
getTimerCountwill not include cancelled immediatesjest-fake-timers: Support
util.promisifyonsetTimeoutjest-jasmine2, jest-circus: Improve error message format for Node's assert.fail
- breaking
jest-leak-detector: Use
weak-napiinstead ofweakpackage jest-mock: Fix for mockReturnValue overriding mockImplementationOnce
jest-reporters: Make node-notifier an optional dependency
jest-reporters: Make all arguments to methods on
BaseReporteroptional: Set MODULE_NOT_FOUND as error code when module is not resolved from paths
jest-resolve-dependencies: Handle dynamic dependencies correctly even when using module maps
jest-snapshot: Remove only the added newlines in multiline snapshots
jest-snapshot: Distinguish empty string from external snapshot not written
- breaking
jest-snapshot: Distinguish empty string from internal snapshot not written
- breaking
jest-snapshot: Remove
reportmethod and throw matcher errors jest-snapshot: Omit irrelevant
receivedproperties when property matchers failjest-transform: Properly cache transformed files across tests
jest-transform: Don't fail the test suite when a generated source map is invalid
- breaking
jest-types: Use less
null | undefinedin config types jest-util: Allow querying process.domain
pretty-format: Correctly detect memoized elements
pretty-format: Fix pretty-format to respect displayName on forwardRef
Chore & Maintenance
- breaking
*: Drop support for Node 6
- breaking
*: Upgrade to Micromatch v4
- breaking
babel-plugin-jest-hoist: Use ESM exports
- breaking
jest: Use ESM exports
- breaking
jest-cli: Use ESM exports
- breaking
jest-cli: Remove re-exports from
@jest/core - breaking
jest-environment-jsdom: Upgrade JSDOM from v11 to v15
- breaking
jest-reporters: Upgrade Istanbul dependencies, which are used for code coverage
- breaking
jest-util: Remove deprecated exports
- breaking
jest-validate: Use ESM exports
25.0.0
22 Aug 2019- 24.x
24.9.0
16 Aug 2019expect: Highlight substring differences when matcher fails, part 1
expect: Highlight substring differences when matcher fails, part 2
expect: Improve report when mock-spy matcher fails, part 1
Features
expect: Highlight substring differences when matcher fails, part 1
expect: Highlight substring differences when matcher fails, part 2
expect: Improve report when mock-spy matcher fails, part 1
expect: Improve report when mock-spy matcher fails, part 2
expect: Improve report when mock-spy matcher fails, part 3
expect: Improve report when mock-spy matcher fails, part 4
expect: Throw matcher error when received cannot be jasmine spy
expect: Improve report when negative CalledWith assertion fails
expect: Improve report when positive CalledWith assertion fails
expect: Display equal values for ReturnedWith similar to CalledWith
expect, jest-snapshot: Change color from green for some args in matcher hints
jest-snapshot: Highlight substring differences when matcher fails, part 3
jest-core: Improve report when snapshots are obsolete
jest-cli: Improve chai support (with detailed output, to match jest exceptions)
*: Manage the global timeout with
--testTimeoutcommand line argument.pretty-format: Render custom displayName of memoized components
jest-validate: Allow
maxWorkersas part of thejest.config.jsjest-runtime: Allow passing configuration objects to transformers
@jest/core, @jest/test-sequencer: Support async sort in custom
testSequencerjest-runtime, @jest/fake-timers: Add
jest.advanceTimersToNextTimer@jest-transform: Extract transforming require logic within
jest-coreinto@jest-transformjest-matcher-utils: Add color options to
matcherHintjest-circus/jest-jasmine2: Give clearer output for Node assert errors
jest-runner: Export all types in the type signature of
jest-runner
Fixes
jest-cli: Detect side-effect only imports when running
--onlyChangedor--changedSincejest-cli: Allow
--maxWorkersto work with % input againbabel-plugin-jest-hoist: Expand list of whitelisted globals in global mocks
jest-core: Make watch plugin initialization errors look nice
jest-snapshot: Prevent inline snapshots from drifting when inline snapshots are updated
jest-haste-map: Don't throw on missing mapper in Node crawler
jest-core: Fix incorrect
passWithNoTestswarningjest-snapshots: Fix test retries that contain snapshots
jest-mock: Fix incorrect assignments when restoring mocks in instances where they originally didn't exist
expect: Fix stack overflow when matching objects with circular references
jest-haste-map: Workaround a node >=12.5.0 bug that causes the process not to exit after tests have completed and cancerous memory growth
Performance
jest-watcher: Minor optimization for JestHook
@jest/reporters: Prevent runaway CPU useage with
--notifyon macOS
24.8.0
5 May 2019jest-circus: Bind to Circus events via an optional event handler on any custom env
expect: Improve report when matcher fails, part 15
jest-cli: Update
--forceExitand "did not exit for one second" message colors
Features
jest-circus: Bind to Circus events via an optional event handler on any custom env
expect: Improve report when matcher fails, part 15
jest-cli: Update
--forceExitand "did not exit for one second" message colorsexpect: Improve report when matcher fails, part 16
jest-runner: Pass docblock pragmas to TestEnvironment constructor
expect: Improve report when matcher fails, part 17
expect: Improve report when matcher fails, part 18
expect: Improve report when matcher fails, part 19
Fixes
jest-each: Fix bug with placeholder values
jest-snapshot: Inline snapshots: do not indent empty lines
@jest/runtime, @jest/transform: Allow custom transforms for JSON dependencies
jest-core: Make
detectOpenHandlesimplyrunInBandjest-haste-map: Fix the
mapperoption which was incorrectly ignoredjest-jasmine2: Fix describe return value warning being shown if the describe function throws
jest-environment-jsdom: Re-declare global prototype of JSDOMEnvironment
jest-snapshot: Handle arrays when merging snapshots
expect: Extract names of async and generator functions
jest-runtime: Fix virtual mocks not being unmockable after previously being mocked
jest-transform: Replace special characters in transform cache filenames to support Windows
jest-config: Allow exactly one project
Performance
jest-runtime: Fix module registry memory leak
jest-resolve: Optimize resolve module path
jest-resolve: Cache current directory
jest-get-type: Simplify checking for primitive
24.7.1
4 Apr 2019@jest/config: Normalize
testSequencerto its absolute path@jest/console: Print to stderr when calling
console.error,console.warnorconsole.assertusing thejest-runtimeCLI
24.7.0
3 Apr 2019- removed
expect: Remove repetition of matcherName and options in matchers
@jest/core, @jest/test-sequencer: Move
testSequencerto individual package@jest/test-sequencer@jest/core, jest-cli, jest-config: Add option
testSequencerallow user use custom sequencer.
Features
@jest/core, @jest/test-sequencer: Move
testSequencerto individual package@jest/test-sequencer@jest/core, jest-cli, jest-config: Add option
testSequencerallow user use custom sequencer.
Fixes
expect: Add negative equality tests for iterables
jest-haste-map: Resolve fs watcher EMFILE error
Chore & Maintenance
- removed
expect: Remove repetition of matcherName and options in matchers
24.6.0
1 Apr 2019: Improve report when matcher fails, part 13
@jest/core: Filter API pre-filter setup hook
jest-snapshot: Improve report when matcher fails, part 14
Features
: Improve report when matcher fails, part 13
@jest/core: Filter API pre-filter setup hook
jest-snapshot: Improve report when matcher fails, part 14
@jest/reporter: Display todo and skip test descriptions when verbose is true
jest-runner: Support default exports for test environments
pretty-format: Support React.Suspense
jest-snapshot: Indent inline snapshots
jest-config: Support colors in
displayNameconfiguration
Fixes
jest-circus: Fix test retries with beforeAll/beforeEach failures
expect: Fix circular references in iterable equality
jest-changed-files: Change method of obtaining git root
jest-each: Fix test function type
jest-fake-timers:
getTimerCountnot taking immediates and ticks into accountjest-runtime: Allow json file as manual mock
pretty-format: Print
BigIntas a readable number instead of{}jest-core: Fix ability to transform dependencies required from globalSetup script
@jest/reporters: Fix Cannot read property converageData of null
jest-worker:
JEST_WORKER_IDstarts at 1jest-config: Use default cwd even if config contains a cwd property
: Remove internal peer dependencies
: Remove internal peer dependencies
: Remove internal peer dependencies
jest-resolve: Fix requireActual with moduleNameMapper
jest-haste-map: Fix haste map duplicate detection in watch mode
Performance
jest-haste-map: Optimize haste map data structure for serialization/deserialization
jest-haste-map: Avoid persisting haste map or processing files when not changed
jest-core: Improve performance of SearchSource.findMatchingTests by 15%
jest-resolve: Optimize internal cache lookup performance
jest-core: Dramatically improve watch mode performance
jest-transform: Cache regular expression instead of creating anew for every file in ScriptTransformer
jest-core: Fix memory leak of source map info and minor performance improvements
jest-console: Fix memory leak by releasing console output reference when printed to stdout
jest-runtime: Use
Mapinstead ofObjectfor module registry
24.5.0
12 Mar 2019jest-haste-map: Expose
throwOnModuleCollisionviaconfig.haste
Features
jest-haste-map: Expose
throwOnModuleCollisionviaconfig.haste
24.4.0
11 Mar 2019jest-resolve: Now supports PnP environment without plugins
expect: Compare DOM nodes even if there are multiple Node classes
jest-worker:
worker.getStdout()can returnnull
Features
jest-resolve: Now supports PnP environment without plugins
Fixes
expect: Compare DOM nodes even if there are multiple Node classes
jest-worker:
worker.getStdout()can returnnulljest-worker: Re-attach stdout and stderr from new processes/threads created after retries
jest-reporters/jest-runner: Serialize
changedFilespassed to workers
24.3.1
7 Mar 201924.3.0
7 Mar 2019- removed
expect: Remove duck typing and obsolete browser support code when comparing DOM nodes and use DOM-Level-3 API instead
- security
jest-cli: Fix prototype pollution vulnerability in dependency
: Improve report when matcher fails, part 10
We skipped 24.2.0 because a draft was accidentally published. Please use
24.3.0or a newer version instead.Features
: Improve report when matcher fails, part 10
: Improve report when matcher fails, part 11
: Improve report when matcher fails, part 12
: Improve report when matcher fails, part 7
: Improve report when matcher fails, part 8
: Improve report when matcher fails, part 9
jest-circus/jest-jasmine2: Warn if describe returns a value
jest-config: Print error information on preset normalization error
jest-get-type: Add
isPrimitivefunctionjest-haste-map: Add
skipPackageJsonoptionjest-util: Add
isPromisepretty-format: Support
React.memo
Fixes
expect: Fix
toStrictEqualnot considering arrays with objects having undefined values correctlyexpect: Fix custom async matcher stack trace
expect: Fix non-object received value in toHaveProperty (#7986, #8067)
expect: Fix non-symmetric equal for Number
- removed
expect: Remove duck typing and obsolete browser support code when comparing DOM nodes and use DOM-Level-3 API instead
jest-changed-files: Fix
getChangedFilesFromRootsto not return parts of the commit messages as if they were files, when the commit messages contained multiple paragraphsjest-changed-files: Fix pattern for HG changed files
jest-changed-files: Improve default file selection for Mercurial repos
jest-circus: Fix bug with test.only
: Throw explicit error when errors happen after test is considered complete
- security
jest-cli: Fix prototype pollution vulnerability in dependency
jest-cli: Refactor
-oand--coveragecombinedjest-environment-node: Add missing globals: TextEncoder and TextDecoder
jest-haste-map: Enforce uniqueness in names (mocks and haste ids)
: Throw explicit error when errors happen after test is considered complete
jest-mock: Adds a type check to
prototypeto allow mocks of objects with a primitiveprototypeproperty.jest-transform: Normalize config and remove unnecessary checks, convert
TestUtils.jsto TypeScriptMake sure to not fail if unable to assign
toStringTagto theprocessobject, which is read only in Node 12jest-validate: Fix validating async functions
jest-worker: Fix
jest-workerwhen using pre-allocated jobsstatic: Remove console log '-' on the front page
Performance
jest-haste-map: Optimize haste map tracking of deleted files with Watchman.