jest-util
30.5.1 · 1 Sep 2026MIT156.2M / weekRepositoryHomepagenpmAtom feed
146 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 22.x
22.0.0
18 Dec 2017- removed
jest-worker: Remove
debugandinspectflags from the arguments sent to the child - breaking
expect: Replace identity equality with Object.is in toBe matcher
- breaking
jest-environment-jsdom: Upgrade to JSDOM@11
Fixes
jest-resolve: Use
module.builtinModulesasBUILTIN_MODULESwhen it exists- removed
jest-worker: Remove
debugandinspectflags from the arguments sent to the child jest-config: Use all
--testPathPatternand<regexForTestFiles>args intestPathPatternjest-cli: Do not support
--watchinside non-version-controlled environmentsjest-config: Escape Windows path separator in testPathPattern CLI arguments
jest-jasmine: Register sourcemaps as node environment to improve performance with jsdom
pretty-format: Do not call toJSON recursively
pretty-format: Fix errors when identity-obj-proxy mocks CSS Modules
babel-jest: Fix support for namespaced babel version 7
expect: Fix .toThrow for promises
jest-docblock: Pragmas should preserve urls
jest-cli: Check if
npm_lifecycle_scriptcalls Jest directlyjest-cli: Fix --showConfig to show all configs
jest-cli: Throw if
maxWorkersdoesn't have a valuejest-cli: Use
fs.realpathSync.nativeif availablejest-config: Fix
--passWithNoTestsjest-config: Support
rootDirtag in testEnvironmentjest-editor-support: Fix
--showConfigto support jest 20 and jest 21jest-editor-support: Fix editor support test for node 4
jest-mock: Support mocking constructor in
mockImplementationOncejest-runtime: Fix manual user mocks not working with custom resolver
jest-util: Fix
runOnlyPendingTimersforsetTimeoutinsidesetImmediatejest-message-util: Always remove node internals from stacktraces
jest-resolve: Changes method of determining builtin modules to include missing builtins
pretty-format: Prevent error in pretty-format for window in jsdom test env
jest-resolve: Preserve module identity for symlinks
jest-config: Include error message for
presetjsonpretty-format: Throw
PrettyFormatPluginErrorif a plugin halts with an exceptionexpect: Keep the stack trace unchanged when
PrettyFormatPluginErroris thrown by pretty-formatjest-environment-jsdom: Fix asynchronous test will fail due to timeout issue.
jest-cli: Fix
--onlyChangedpath case sensitivity on Windows platformjest-runtime: Use realpath to match transformers
- breaking
expect: Replace identity equality with Object.is in toBe matcher
Features
jest-config: Add Global Setup/Teardown options
jest-config: Add
testEnvironmentOptionsto apply to jsdom options or node context.jest-jasmine2: Update Timeout error message to
jest.timeoutand display current timeout valuejest-runner: Enable experimental detection of leaked contexts
jest-cli: Add combined coverage threshold for directories.
jest-mock: Add
timestampsto mock state.eslint-plugin-jest: Add
prefer-to-have-lengthlint rule.- breaking
jest-environment-jsdom: Upgrade to JSDOM@11
- breaking
jest-environment-*: Add Async Test Environment APIs, dispose is now teardown
jest-cli: Add an option to clear the cache
babel-plugin-jest-hoist: Improve error message, that the second argument of
jest.mockmust be an inline function- breaking
jest-snapshot: Concatenate name of test and snapshot
- breaking
jest-cli: Fail if no tests are found
jest-diff: Highlight only last of odd length leading spaces
jest-docblock: Add
docblock.print()jest-docblock: Add
stripjest-docblock: Preserve leading whitespace in docblock comments
jest-docblock: Remove leading newlines from
parswWithComments().commentsjest-editor-support: Add Snapshots metadata
jest-editor-support: Adds an 'any' to the typedef for
updateFileWithJestStatusjest-editor-support: Better monorepo support
jest-environment-jsdom: Add simple rAF polyfill in jsdom environment to work with React 16
jest-environment-node: Implement node Timer api
jest-jasmine2: Add testPath to reporter callbacks
jest-mock: Added support for naming mocked functions with
.mockName(value)and.mockGetName()jest-runtime: Add
module.loaded, and makemodule.requirenot enumerablejest-runtime: Add
module.parentjest-runtime: Support sourcemaps in transformers
- breaking
jest-snapshot: Add a serializer for
jest.fnto allow a snapshot of a jest mock jest-worker: Initial version of parallel worker abstraction, say hello!
jest-jasmine2: Add
testLocationInResultsflag to add location information per spec to test resultsjest-environment-jsdom: Update JSOM to 11.4, which includes built-in support for
requestAnimationFramejest-cli: Hide watch usage output when running on non-interactive environments
jest-snapshot: Promises support for
toThrowErrorMatchingSnapshotjest-cli: Explain which snapshots are obsolete
Chore & Maintenance
- breaking
*: Drop support for Node.js version 4
- 21.x
21.2.1
27 Sep 2017Fix watchAll not running tests on save
Add missing escape sequences to ConvertAnsi plugin
21.2.0
26 Sep 2017🃏 Change license from BSD+Patents to MIT.
Allow eslint-plugin to recognize more disabled tests
Add babel-plugin for object spread syntax to babel-preset-jest
🃏 Change license from BSD+Patents to MIT.
Allow eslint-plugin to recognize more disabled tests
Add babel-plugin for object spread syntax to babel-preset-jest
Display outer element and trailing newline consistently in jest-diff
Do not modify stack trace of JestAssertionError
Print errors after test structure in verbose mode
Fix
--silent --verboseproblemReset local state of assertions when using hasAssertions
jest-resolve: Prevent default resolver failure when potential resolution directory does not exist
21.1.0
14 Sep 2017(minor) Use ES module exports
Allow chaining mockClear and mockReset
Call jest-diff and pretty-format more precisely in toHaveProperty matcher
(minor) Use ES module exports
Allow chaining mockClear and mockReset
Call jest-diff and pretty-format more precisely in toHaveProperty matcher
Expose restoreAllMocks to object
Fix function name cleaning when making mock fn
Fix Map/Set equality checker
Make FUNCTION_NAME_RESERVED_PATTERN stateless
21.0.2
8 Sep 2017Take precedence of NODE_PATH when resolving node_modules directories
Fix race condition with --coverage and babel-jest identical file contents edge case
Add extra parameter
--runTestsByPath.
Take precedence of NODE_PATH when resolving node_modules directories
Fix race condition with --coverage and babel-jest identical file contents edge case
Add extra parameter
--runTestsByPath.Upgrade all outdated deps
21.0.0
4 Sep 2017- deprecated
jest-haste-map: Deprecate functional ignorePattern and use it in cache key
Add --changedFilesWithAncestor
Add --findRelatedFiles
Add --changedFilesWithAncestor
Add --findRelatedFiles
Add --onlyChanged tests
Add
contextLinesoption to jest-diffAdd alternative serialize API for pretty-format plugins
Add displayName to MPR
Add displayName to TestResult
Add es5 build of pretty-format
Add extra info to no tests for changed files message
Add fake chalk in browser builds in order to support IE10
Add jest.requireActual
Add maxWorkers to globalConfig
Add skipped tests support for jest-editor-support
Add source map support for better debugging experience
Add support for Error objects in toMatchObject
Add support for Immutable.Record in pretty-format
Add tests for extract_requires on export types
Add that toMatchObject can match arrays
Add watchPathIgnorePatterns to exclude paths to trigger test re-run in watch mode
Adding ancestorTitles property to JSON test output
Allow custom resolver to be used with[out] moduleNameMapper
Avoid parsing
.require(…)method callsAvoid unnecessary function declarations and call in pretty-format
Avoid writing to stdout in default reporter if --json is enabled. Fixes #3941
Better error handling for --config
Call consistent pretty-format plugins within Jest
Change babel-core to peerDependency for compatibility with Babel 7
Change Promise detection code in jest-circus to support non-global Promise implementations
Changed files eager loading
Check whether we should output to stdout or stderr
Clarify what objects toContain and toContainEqual can be used on
Clean up resolve() logic. Provide useful names for variables and functions. Test that a directory exists before attempting to resolve files within it.
cleanupStackTrace
Compare objects with Symbol keys
Complain if expect is passed multiple arguments
Completes nodeCrawl with empty roots
Consistent naming of files
Convert code base to ESM import
Correct summary message for flag --findRelatedTests.
Coverage thresholds can be set up for individual files
Custom reporter error handling
Define separate type for pretty-format plugin Options
Delete confusing async keyword
Delete redundant branch in ReactElement and HTMLElement plugins
Don't format node assert errors when there's no 'assert' module
Don't print test summary in --silent
Don't try to build ghost packages
Escape double quotes in attribute values in HTMLElement plugin
Explain how to clear the cache
Factor out common code for collections in pretty-format
Factor out common code for markup in React plugins
Feature/internal resolve
Fix --logHeapUsage
Fix --showConfig to show all project configs
Fix --watchAll
Fix bug when setTimeout is mocked
Fix changedFilesWithAncestor
Fix colors for expected/stored snapshot message
Fix concurrent test failure
Fix for 4286: Compare Maps and Sets by value rather than order
Fix forceExit
Fix grammar in React Native docs
Fix inconsistent name of complex values in pretty-format
Fix issue mocking bound method
Fix jest-circus
Fix lint warning in master
Fix linting
Fix merge conflict
Fix missing console.log messages
Fix mock return value
Fix mocking for modules with folders on windows
Fix NODE_PATH resolving for relative paths
Fix options.moduleNameMapper override order with preset (#3565
Fix React PropTypes warning in tests for Immutable plugin
Fix regression in mockReturnValueOnce
Fix sample code of mock class constructors
Fix setup-test-framework-test
Fix typescript jest test crash
Fix watch mode
Fix Watchman on windows
babel: Handle ignored files in babel v7
babel: Support upcoming beta
Fixed object matcher
Fixes #3820 use extractExpectedAssertionsErrors in jasmine setup
Flow upgrade
Force message in matchers to always be a function
Format
describeand usetestinstead ofitaliasglobal_config.js for multi-project runner
Handle async errors
Hard-fail if hasteImpl is throwing an error during initialization.
Ignore import type for extract_requires
Ignore indentation of data structures in jest-diff
Implement 'jest.requireMock'
Improve Jest phabricator plugin
Improve Seq and remove newline from non-min empty in Immutable plugin
Improved the jest reporter with snapshot info per test.
Include fullName in formattedAssertion
Integrated with Yarn workspaces
Jest --all
jest-circus test failures
jest-circus Timeouts
jest-haste-map: Add test case for broken handling of ignore pattern
jest-haste-map: Add test+fix for broken platform module support
- deprecated
jest-haste-map: Deprecate functional ignorePattern and use it in cache key
jest-haste-map: Mock 'fs' with more idiomatic jest.mock()
jest-haste-map: Only file IO errors should be silently ignored
jest-haste-map: Throw when trying to get a duplicated module
jest-haste-map: Watchman crawler: normalize paths
jest-runtime: Atomic cache write, and check validity of data
Join lines with newline in jest-diff
Keep ARGV only in CLI files
Let transformers adjust cache key based on mapCoverage
Lift requires
Log stack when reporting errors in jest-runtime
Make --listTests return a new line separated list when not using --json
Make build script printing small-terminals-friendly
Make error messages more explicit for toBeCalledWith assertions
Make jest-matcher-utils use ESM exports
Make jest-runner a standalone package.
Make Jest’s Test Runner configurable.
Make listTests always print to console.log
Make providesModuleNodeModules ignore nested node_modules directories
Make sure function mocks match original arity
Make sure runAllTimers also clears all ticks
Make toBe matcher error message more helpful for objects and arrays
Make useRealTimers play well with timers: fake
Move getType from jest-matcher-utils to separate package
Multiroot jest-change-files
Output created snapshot when using --ci option
Point out you can use matchers in .toMatchObject
Prevent babelrc package import failure on relative current path
Print RDP details for windows builds
Provide better error checking for transformed content
Provide printText and printComment in markup.js for HTMLElement plugin
Provide regex visualization for testRegex
Refactor CLI
Refactor names and delimiters of complex values in pretty-format
Replace concat(Immutable) with Immutable as item of plugins array
Replace Jasmine with jest-circus
Replace match with test and omit redundant String conversion
Replace print with serialize in AsymmetricMatcher plugin
Replace print with serialize in ConvertAnsi plugin
Replace print with serialize in HTMLElement plugin
Replace print with serialize in Immutable plugins
Replace unchanging args with one config arg within pretty-format
Return UNDEFINED for undefined type in ReactElement plugin
Rewrite some read bumps in pretty-format
Run update method before installing JRE on Circle
Separated the snapshot summary creation from the printing to improve testability.
Set coverageDirectory during normalize phase
Setup custom reporters after default reporters
Setup for Circle 2
Simplify readme
Simplify snapshots definition
skipNodeResolution config option
Small fixes to toHaveProperty docs
Sort attributes by name in HTMLElement plugin
Specify watchPathIgnorePatterns will only be available in Jest 21+
Split TestRunner off of TestScheduler
Strict and explicit config resolution logic
Support maxDepth option in React plugins
Support SVG elements in HTMLElement plugin
Test empty Immutable collections with {min: false} option
Test to debug travis failure in master
testPathPattern message test
Throw Error When Using Nested It Specs
Throw when moduleNameMapper points to inexistent module
Unified 'no tests found' message for non-verbose MPR
Update migration guide with jest-codemods transformers
Use "inputSourceMap" for coverage re-mapping.
Use "verbose" no test found message when there is only one project
Use babel transform to inline all requires
Use eslint plugins to run prettier
Use iterableEquality in spy matchers
Use modern HTML5 <!DOCTYPE>
Wrap
Error.captureStackTracein a try
- 20.x
20.0.3
17 May 2017Fix reporters 'default' setting.
Fix to make Jest fail when the coverage threshold not met.
20.0.2
17 May 201720.0.1
11 May 2017Add ansi-regex to pretty-format dependencies
Fix <rootDir> replacement in testMatch and moduleDirectories
Fix expect.hasAssertions() to throw when passed arguments
Add ansi-regex to pretty-format dependencies
Fix <rootDir> replacement in testMatch and moduleDirectories
Fix expect.hasAssertions() to throw when passed arguments
Fix stack traces without proper error messages
Fix support for custom extensions through haste packages
Fix test contexts between test functions
20.0.0
6 May 2017- breaking
Forked Jasmine 2.5 into Jest's own test runner and rewrote large parts of Jasmine.
- breaking
Jest does not write new snapshots by default on CI.
- breaking
Moved the typescript parser from
jest-editor-supportinto a separatejest-test-typescript-parserpackage.
New
--projectsoption to run one instance of Jest in multiple projects at the same time.New multi project runner
New --listTests flag.
New --showConfig flag.
New promise support for all
expectmatchers through.resolvesand.rejects.New
expect.hasAssertions()function similar toexpect.assertions().New
this.equalsfunction exposed to custom matchers.New
valid-expectlint rule ineslint-plugin-jest.New HtmlElement pretty-format plugin.
New Immutable pretty-format plugins.
New test environment per file setting through
@jest-environmentin the docblock.New feature that allows every configuration option to be set from the command line.
New feature to add custom reporters to Jest through
reportersin the configuration.New feature to add expected and actual values to AssertionError.
New feature to map code coverage from transformers.
New feature to run untested code coverage in parallel.
New option to define a custom resolver.
New printing support for text and comment nodes in html pretty-format.
New snapshot testing FAQ
New support for custom platforms on jest-haste-map.
New support for mocking native async methods.
New guide on how to use Jest with any JavaScript framework.
New translation system for the Jest website.
New collapsing watch mode usage prompt after first run.
- breaking
Forked Jasmine 2.5 into Jest's own test runner and rewrote large parts of Jasmine.
- breaking
Jest does not write new snapshots by default on CI.
- breaking
Moved the typescript parser from
jest-editor-supportinto a separatejest-test-typescript-parserpackage. - breaking
Replaced auto-loading of babel-polyfill with only regenerator-runtime, fixes a major memory leak.
Fixed
babel-jestto look up thebabelfield inpackage.jsonas a fallback.Fixed
jest-editor-support's parser to not crash on incomplete ASTs.Fixed
jest-resolveto useis-builtin-moduleinstead ofresolve.isCore.Fixed
jest-snapshotto normalize line endings in theserializefunction.Fixed behavior of
--silentflag.Fixed bug with watchers on macOS causing test to crash.
Fixed CLI
notifyoption not taking precedence over config option.Fixed detection of the npm client in SummaryReporter to support Yarn.
Fixed done.fail not passing arguments
Fixed fake timers to restore after resetting mocks.
Fixed handling of babylon's parser options in
jest-editor-support.Fixed Jest to properly cache transform results.
Fixed Jest to use human-readable colors for Jest's own snapshots.
Fixed jest-config to use UID for default cache folder. (#3380),
Fixed jest-runtime to expose inner error when it fails to write to the cache.
Fixed lifecycle hooks to make afterAll hooks operate the same as afterEach.
Fixed pretty-format to run plugins before serializing nested basic values.
Fixed return value of mocks so they can explicitly be set to return
undefined.Fixed runner to run tests associated with snapshots when the snapshot changes.
Fixed snapshot serializer require, restructured pretty-format.
Fixed support for Babel 7 in babel-jest.
Fixed testMatch to find tests in .folders.
Fixed testNamePattern and testPathPattern to work better together.
Fixed to show reject reason when expecting resolve.
Fixed toHaveProperty() to use hasOwnProperty from Object
Fixed watch mode's screen clearing.
Improved and consolidated Jest's configuration file resolution.
Improved documentation throughout the Jest website.
Improved documentation to explicitly mention that snapshots must be reviewed.
Improved documentation to make it clear CRA users don't need to add dependencies.
Improved eslint-plugin-jest's handling of
expect.Improved flow-coverage, eslint rules and test coverage within the Jest repository.
Improved printing of
expect.assertionserror.Improved Windows test coverage of Jest.
Refactored configs & transform
Refactored reporters to pass individual Tests to reporters.
Refactored TestRunner
Refactored watch mode prompts.
Deleted
jest-file-exists.Removed
Configtype.Removed all usage of
jest-file-exists.Adopted prettier on the Jest codebase.
- 19.x
19.0.2
23 Feb 201719.0.1
22 Feb 2017Fix infinite loop when using
--watchwith--coverage.Fixed
watchmanconfig option.Fixed a bug in the jest-editor-support static analysis.
Fix infinite loop when using
--watchwith--coverage.Fixed
watchmanconfig option.Fixed a bug in the jest-editor-support static analysis.
Fixed eslint plugin warning.
Fixed missing space in front of "Did you mean …?".
Fixed path printing in the reporter on Windows.
19.0.0
21 Feb 2017- breaking
Added a version for snapshots.
- breaking
Removed the
mocksPatternconfiguration option, it never worked correctly. - breaking
Renamed
testPathDirstorootsto avoid confusion when configuring Jest.
- breaking
Added a version for snapshots.
- breaking
Removed the
mocksPatternconfiguration option, it never worked correctly. - breaking
Renamed
testPathDirstorootsto avoid confusion when configuring Jest. - breaking
Updated printing of React elements to cause fewer changes when props change.
- breaking
Updated snapshot format to properly escape data.
Fixed --color to be recognized correctly again.
Fixed
babel-plugin-jest-hoistto work properly with type annotations in tests.Fixed behavior for console.log calls and fixed a memory leak (#2539).
Fixed cache directory path for Jest to avoid ENAMETOOLONG errors.
Fixed change events to be emitted in jest-haste-map's watch mode. This fixes issues with Jest's new watch mode and react-native-packager.
Fixed cli arguments to be used when loading the config from file, they were previously ignored.
Fixed Jest to load json files that include a BOM.
Fixed Jest to throw errors instead of ignoring invalid cli options.
Fixed mocking behavior for virtual modules.
Fixed mocking behavior with transitive dependencies.
Fixed support for asymmetric matchers in
toMatchObject.Fixed test interruption and
--bailbehavior.Fixed watch mode to clean up worker processes when a test run gets interrupted.
Fixed whitespace to be highlighted in snapshots and assertion errors.
Improved
babel-jestplugin: babel is loaded lazily, istanbul comments are only added when coverage is used.Improved error for invalid transform config.
Improved moduleNameMapper to not overwrite mocks when many patterns map to the same file.
Improved printing of skipped tests in verbose mode.
Improved resolution code in jest-resolve.
Improved to only show patch marks in assertion errors when the comparison results in large objects.
New
--collectCoverageFromcli argument.New
--coverageDirectorycli argument.New
expect.addSnapshotSerializerto add custom snapshot serializers for tests.New
jest.spyOn.New
testMatchconfiguration option that accepts glob patterns.New eslint-plugin-jest with no-disabled-tests, no-focuses-tests and no-identical-title rules and default configuration and globals.
New expect.stringContaining asymmetric matcher.
New feature to make manual mocks with nested folders work. For example
__mocks__/react-native/Library/Text.jswill now work as expected.New feature to re-run tests through the notification when using
--notify.New jest-phabricator package to integrate Jest code coverage in phabriactor.
New jest-validate package to improve configuration errors, help with suggestions of correct configuration and to be adopted in other libraries.
New pretty-printing for asymmetric matchers.
New RSS feed for Jest's blog.
New way to provide a reducer to extract haste module ids.
New website, new documentation, new color scheme and new homepage.
Rewritten watch mode for instant feedback, better code quality and to build new features on top of it (#2362).
- 18.x
18.1.0
29 Dec 2016Fixed console.log and fake timer behavior in node 7.3.
Updated istanbul-api.
Updated jest-diff equality error message.
Fixed console.log and fake timer behavior in node 7.3.
Updated istanbul-api.
Updated jest-diff equality error message.
Disabled arrow keys when entering a pattern in watch mode to prevent broken behavior. Will be improved in a future release.
Moved asymmetric matchers and equality functionality from Jasmine into jest-matchers.
Removed jasmine and jest-snapshot dependency from jest-matchers.
Removed unused global
contextvariable.Show a better error message if the config is invalid JSON.
Highlight trailing whitespace in assertion diffs and snapshots.
Jest now uses micromatch instead of minimatch.
Added
-has alias for--help.
18.0.0
15 Dec 2016The testResultsProcessor function is now required to return the modified results.
Removed
pitandmockImpl. UseitormockImplementationinstead.Fixed re-running tests when
--bailis used together with--watch.
See jestjs.io/blog/2016/12/15/2016-in-jest.html
The testResultsProcessor function is now required to return the modified results.
Removed
pitandmockImpl. UseitormockImplementationinstead.Fixed re-running tests when
--bailis used together with--watch.pretty-formatis now merged into Jest.require('v8')now works properly in a test context.Jest now clears the entire scrollback in watch mode.
Added
expect.any,expect.anything,expect.objectContaining,expect.arrayContaining,expect.stringMatching.Properly resolve
snapshotSerializers,setupFiles,transform,testRunnerandtestResultsProcessorinstead of usingpath.resolve.--testResultsProcessoris now exposed through the cli.Renamed
--jsonOutputFileto--outputFile.Added
jest-editor-supportfor vscode and Nuclide integration.Fixed
test.concurrentunhandled promise rejections.The Jest website is now auto-deployed when merging into master.
Updated
testRegexto includetest.jsandspec.jsfiles.Fixes for
babel-plugin-jest-hoistwhen usingjest.mockwith three arguments.The
JSONglobal injest-environment-nodenow comes from the vm context instead of the parent context.Jest does not print stack traces from babel any longer.
Fake timers are reset when
FakeTimers.useTimers()is called.Usage of Jest in watch mode can be hidden through
JEST_HIDE_USAGE.Added
expect.assertions(number)which will ensure that a specified amount of assertions is made in one test.Added
.toMatchSnapshot(?string)feature to give snapshots a name.Escape regex in snapshots.
jest-react-nativewas deprecated and now forwardsreact-native.Added
.toMatchObjectmatcher.Further improve printing of large objects.
Fixed
NaN% Failedin the OS notification when using--notify.The first test run without cached timings will now use separate processes instead of running in band.
Added
.toHavePropertymatcher.Fixed
Map/Setcomparisons.test.concurrentnow works with--testNamePattern.
- 17.x
17.0.2
15 Nov 2016Fixed performance regression in module resolution.
17.0.0
8 Nov 2016Added
expect.extend.Properly resolve modules with platform extensions on react-native.
Added support for custom snapshots serializers.
Added
expect.extend.Properly resolve modules with platform extensions on react-native.
Added support for custom snapshots serializers.
Updated to Jasmine 2.5.2.
Big diffs are now collapsed by default in snapshots and assertions. Added
--expand(or-e) to show the full diff.Replaced
scriptPreprocessorwith the newtransformoption.Added
jest.resetAllMockswhich replacesjest.clearAllMocks.Fixes for react-native preset.
Fixes for global built in objects in
jest-environment-node.Create mock objects in the vm context instead of the parent context.
.babelrcis now part of the transform cache key inbabel-jest.Fixes for docblock parsing with haste modules.
Exit with the proper code when the coverage threshold is not reached.
Implemented file watching in
jest-haste-map.--jsonnow includes information about individual tests inside a file.
- 16.x
16.0.2
20 Oct 2016Symbols are now properly mocked when using
jest-mock.toHaveBeenCalledWith()works without arguments again.Newlines in snapshots are now normalized across different operating systems.
16.0.0
3 Oct 2016- removed
Removed react-native special case in Jest's configuration.
Previously failed tests are now always run first.
A new concurrent reporter shows currently running tests, a test summary, a progress bar and estimated remaining time if possible.
Previously failed tests are now always run first.
A new concurrent reporter shows currently running tests, a test summary, a progress bar and estimated remaining time if possible.
Improved CLI colors.
jest <pattern>is now case-insensitive.Added
it.only,it.skip,test.only,test.skipandxtest.Added
--testNamePattern=patternor-t <pattern>to run individual tests in test files.Jest now warns for duplicate mock files.
Pressing
a,o,p,qorenterwhile tests are running in the watch mode, the test run will be interrupted.--bailnow works together with--watch.Added
test.concurrentfor concurrent async tests.Jest now automatically considers files and tests with the
.jsxextension.Added
jest.clearAllMocksto clear all mocks manually.Rewrote Jest's snapshot implementation.
jest-snapshotcan now be more easily integrated into other test runners and used in other projects.This requires most snapshots to be updated when upgrading Jest.
Objects and Arrays in snapshots are now printed with a trailing comma.
Function names are not printed in snapshots any longer to reduce issues with code coverage instrumentation and different Node versions.
Snapshots are now sorted using natural sort order.
Snapshots are not marked as obsolete any longer when using
fitor when an error is thrown in a test.Finished migration of Jasmine matchers to the new Jest matchers.
Pretty print
toHaveBeenLastCalledWith,toHaveBeenCalledWith,lastCalledWithandtoBeCalledWithfailure messages.Added
toBeInstanceOfmatcher.Added
toContainEqualmatcher.Added
toThrowErrorMatchingSnapshotmatcher.Improved
moduleNameMapperresolution.Module registry fixes.
Fixed invocation of the
setupTestFrameworkScriptFilescript to make it easier to use chai together with Jest.- removed
Removed react-native special case in Jest's configuration.
Added
--findRelatedTests <fileA> <fileB>cli option to run tests related to the specified files.Added
jest.deepUnmocktobabel-plugin-jest-hoist.Added
jest.runTimersToTimewhich is useful together with fake timers.Improved automated mocks for ES modules compiled with babel.
- 15.x
15.1.1
2 Sep 2016Fixed issues with test paths that include hyphens on Windows.
Fixed
testEnvironmentresolution.Updated watch file name pattern input.
15.1.0
1 Sep 2016Pretty printer updates for React and global window objects.
jest-runtimeoverwrites automocking from configuration files.Improvements for watch mode on Windows.
Pretty printer updates for React and global window objects.
jest-runtimeoverwrites automocking from configuration files.Improvements for watch mode on Windows.
afterAll/afterEach/beforeAll/beforeEach can now return a Promise and be used together with async/await.
Improved stack trace printing on Node 4.
15.0.1
1 Sep 2016Updated toThrow and toThrowMatchers and aliased them to the same matcher.
Improvements for watch mode.
Fixed Symbol reassignment in tests would break Jest's matchers.
Updated toThrow and toThrowMatchers and aliased them to the same matcher.
Improvements for watch mode.
Fixed Symbol reassignment in tests would break Jest's matchers.
Fixed
--bailoption.
15.0.0
31 Aug 2016Jest by default now also recognizes files ending in
.spec.jsand.test.jsas test files.Completely replaced most Jasmine matchers with new Jest matchers.
Rewrote Jest's CLI output for test failures and summaries.
Jest by default now also recognizes files ending in
.spec.jsand.test.jsas test files.Completely replaced most Jasmine matchers with new Jest matchers.
Rewrote Jest's CLI output for test failures and summaries.
Added
--envoption to override the default test environment.Disabled automocking, fake timers and resetting the module registry by default.
Added
--watchAll, made--watchinteractive and added the ability to update snapshots and select test patterns in watch mode.Jest uses verbose mode when running a single test file.
Console messages are now buffered and printed along with the test results.
Fix
testEnvironmentresolution to preferjest-environment-{name}instead of{name}only. This prevents a module colision when usingjsdomas test environment.moduleNameMappernow uses a resolution algorithm.Improved performance for small test runs.
Improved API documentation.
Jest now works properly with directories that have special characters in them.
Added
global.globalto the node environment.Fixed babel-jest-plugin-hoist issues with functions called
mock.Improved jest-react-native preset with mocks for ListView, TextInput, ActivityIndicator and ScrollView.
Added
collectCoverageFromto collect code coverage from untested files.Rewritten code coverage support.
- 14.x
14.0.0
27 Jul 2016Official release of snapshot tests.
Started to replace Jasmine matchers with Jest matchers:
toBe,toBeFalsy,toBeTruthy,toBeNaN,toBe{Greater,Less}Than{,OrEqual},toBeNull,toBeDefined,toBeUndefined,toContain,toMatch,toBeCloseTowere rewritten.Rewrite of Jest's reporters.
Official release of snapshot tests.
Started to replace Jasmine matchers with Jest matchers:
toBe,toBeFalsy,toBeTruthy,toBeNaN,toBe{Greater,Less}Than{,OrEqual},toBeNull,toBeDefined,toBeUndefined,toContain,toMatch,toBeCloseTowere rewritten.Rewrite of Jest's reporters.
Experimental react-native support.
Removed Jasmine 1 support from Jest.
Transform caching improvements.
- 13.x
13.1.0
5 Jul 2016Added
testglobal function as an alias forit.Added
coveragePathIgnorePatternsto the config.Fixed printing of "JSX objects" in snapshots.
Added
testglobal function as an alias forit.Added
coveragePathIgnorePatternsto the config.Fixed printing of "JSX objects" in snapshots.
Fixes for
--verboseoption and top levelitcalls.Extended the node environment with more globals.
Testcheck now needs to be required explicitly through
require('jest-check').Added
jest.deepUnmock.Fail test suite if it does not contain any tests.
13.0.0
22 Jun 2016Added duration of individual tests in verbose mode.
Added a
browserconfig option to properly resolve npm packages with a browser field inpackage.jsonif you are writing tests for client side appsAdded
jest-repl.
Added duration of individual tests in verbose mode.
Added a
browserconfig option to properly resolve npm packages with a browser field inpackage.jsonif you are writing tests for client side appsAdded
jest-repl.Split up
jest-cliintojest-runtimeandjest-config.Added a notification plugin that shows a test run notification using
--notify.Refactored
TestRunnerintoSearchSourceand improved the "no tests found" message.Added
jest.isMockFunction(jest.fn())to test for mock functions.Improved test reporter printing and added a test failure summary when running many tests.
Add support for property testing via testcheck-js.
Added a webpack tutorial.
Added support for virtual mocks through
jest.mock('Module', implementation, {virtual: true}).Added snapshot functionality through
toMatchSnapshot().Redesigned website.
- 12.x
12.1.0
20 May 2016Jest is now also published in the
jestpackage on npm.Added
testRegexto match for tests outside of specific folders. Deprecated bothtestDirectoryNameandtestFileExtensions.itcan now return a Promise for async testing.pitwas deprecated.
Jest is now also published in the
jestpackage on npm.Added
testRegexto match for tests outside of specific folders. Deprecated bothtestDirectoryNameandtestFileExtensions.itcan now return a Promise for async testing.pitwas deprecated.Added
jest-resolveas a standalone package based on the Facebook module resolution algorithm.Added
jest-changed-filesas a standalone package to detect changed files in a git or hg repo.Added
--setupTestFrameworkFileto cli.Added support for coverage thresholds. See jestjs.io/docs/en/configuration.
Updated to jsdom 9.0.
Updated and improved stack trace reporting.
Added
module.filenameand removed the invalidmodule.__filenamefield.Further improved the
lastCalledWithandtoBeCalledWithcustom matchers. They now print the most recent calls.Fixed jest-haste-map on continuous integration systems.
Fixes for hg/git integration.
Added a re-try for the watchman crawler.
12.0.2
28 Apr 2016Bug fixes when running a single test file and for scoped package names.
12.0.1
27 Apr 2016Added custom equality matchers for Map/Set and iterables.
Bug fixes
12.0.0
27 Apr 2016- 11.x
- 10.x
- 9.x
9.0.3
23 Mar 2016- 1.x
1.0.0
17 Mar 2016- 0.0.x