jest-mock
30.5.2 · 18 Sep 2026MIT94.8M / weekRepositoryHomepagenpmAtom feed
129 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 27.x
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.3
29 May 2021jest-config:
require.resolveon default test sequencer and test environmentjest-mock: Fixed
fnandspyOnexports
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
- 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.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.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 2020Reading the note…
25.3.0
8 Apr 2020Reading the note…
25.2.6
2 Apr 2020Reading the note…
25.2.5
2 Apr 2020Reading the note…
25.2.3
26 Mar 2020Reading the note…
25.2.1
26 Mar 2020Reading the note…
25.2.0
25 Mar 2020Reading the note…
25.1.0
22 Jan 2020Reading the note…
25.0.0
22 Aug 2019Reading the note…
- 24.x
24.9.0
16 Aug 2019Reading the note…
24.8.0
5 May 2019Reading the note…
24.7.0
3 Apr 2019Reading the note…
24.6.0
1 Apr 2019Reading the note…
24.5.0
12 Mar 2019Reading the note…
24.3.0
7 Mar 2019Reading the note…
24.0.0
25 Jan 2019Reading the note…
- 23.x
23.2.0
25 Jun 2018Reading the note…
23.1.0
30 May 2018Reading the note…
23.0.2
30 May 2018Reading the note…
23.0.1
27 May 2018Reading the note…
23.0.0
24 May 2018Reading the note…
- 22.x
22.4.3
21 Mar 2018Reading the note…
22.2.0
7 Feb 2018Reading the note…
22.1.0
15 Jan 2018Reading the note…
22.0.6
11 Jan 2018Reading the note…
22.0.5
9 Jan 2018Reading the note…
22.0.3
19 Dec 2017Reading the note…
22.0.2
19 Dec 2017Reading the note…
22.0.1
18 Dec 2017Reading the note…
22.0.0
18 Dec 2017Reading the note…
- 21.x
21.2.0
26 Sep 2017Reading the note…
21.1.0
14 Sep 2017Reading the note…
21.0.2
8 Sep 2017Reading the note…
21.0.0
4 Sep 2017Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.