babel-jest
30.5.2 · 18 Sep 2026MIT71.6M / weekRepositoryHomepagenpmAtom feed
163 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 24.x
24.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.
24.1.0
5 Feb 2019: Pass default resolver into custom resolvers
:
global{Setup,Teardown}use default export with es modulesjest-runtime: Better error messages when the jest environment is used after teardown by async code
Features
: Pass default resolver into custom resolvers
:
global{Setup,Teardown}use default export with es modulesjest-runtime: Better error messages when the jest environment is used after teardown by async code
jest-jasmine2: Will now only execute at most 5 concurrent tests within the same testsuite when using
test.concurrentjest-circus: Same as
[jest-jasmine2], only 5 tests will run concurrently by defaultjest-config: A new
maxConcurrencyoption allows to change the number of tests allowed to run concurrently
Fixes
jest-runtime: Fix for mocks not working with module name mapper
jest-cli: Break dependency cycle when using Jest programmatically
jest-config: Extract setupFilesAfterEnv from preset
jest-cli: Do not execute any
globalSetuporglobalTeardownif there are no tests to executejest-runtime: Lock down version of
write-file-atomicjest-cli: Print log entries when logging happens after test environment is torn down
jest-config: Do not use a uuid as
namesince that breaks cachingjest-config: Make sure
normalizecan consumeDefaultswithout warningsjest-config: Allow
moduleFileExtensionswithout 'js' for custom runnersjest-cli: Load transformers before installing require hooks
jest-cli: Handle missing
numTodoTestsin test resultsjest-runtime: Exclude setup/teardown files from coverage report
babel-jest: Throw an error if
babel-jesttries to transform a file ignored by Babelbabel-plugin-jest-hoist: Ignore TS type references when looking for out-of-scope references
expect: Fixed asymmetrical equality of cyclic objects
24.0.0
25 Jan 2019- breaking
jest-each: Add primitive pretty printing for interpolated titles
- breaking
jest-diff: Support diffing numbers and booleans instead of returning null for different ones
- breaking
jest-diff: Replace
diffwithdiff-sequencespackage
Features
- breaking
jest-each: Add primitive pretty printing for interpolated titles
jest-runtime: Add
jest.isolateModulesfor scoped module initialization- breaking
jest-diff: Support diffing numbers and booleans instead of returning null for different ones
- breaking
jest-diff: Replace
diffwithdiff-sequencespackage - breaking
jest-cli: Only set error process error codes when they are non-zero
- breaking
jest-config: Deprecate
setupTestFrameworkScriptFilein favor of newsetupFilesAfterEnv - breaking
jest-worker: Add functionality to call a
setupmethod in the worker before the first call and ateardownmethod when ending the farm - breaking
jest-config: Set default
notifyModetofailure-change - breaking
jest-haste-map: Remove support for
@providesModule - breaking
jest-haste-map: Replace internal data structures to improve performance
- breaking
jest-haste-map: Use relative paths to allow remote caching
- breaking
jest-haste-map: Remove name from hash in
HasteMap.getCacheFilePath - breaking
babel-preset-jest: Export a function instead of an object for Babel 7 compatibility
- breaking
jest-haste-map: Expose relative paths when getting the file iterator
- breaking
jest-cli: Run code transforms over
global{Setup,Teardown} jest-haste-map: Add
hasteFS.getSize(path)jest-cli: Print version ending in
-devwhen running a local Jest clonejest-cli: Add Support for
globalSetupandglobalTeardownin projectsjest-runtime: Add
extraGlobalsto config to load extra global variables into the execution vmjest-util: Export
specialCharscontaining Unicode characters and ANSI escapes for console outputjest-config: Handle typescript (
tsandtsx) by defaultjest-validate: Add support for comments in
package.jsonusing a"//"keyjest-config: Add shorthand for watch plugins and runners
jest-jasmine2/jest-circus/jest-cli: Add test.todo
pretty-format: Option to not escape strings in diff messages
jest-haste-map: Add
getFileIteratortoHasteFSfor faster file iterationjest-config: Add
readConfigsfunction, previously injest-clijest-snapshot: Enable configurable snapshot paths
pretty-format: Support HTMLCollection and NodeList in DOMCollection plugin
jest-runtime: Pass the normalized configuration to script transformers
expect: Improve report when assertion fails, part 3
jest-runtime: If
requirefails without a file extension, print all files that match with onejest-haste-map: Make
ignorePatternoptionaljest-haste-map: Add
getCacheFilePathto get the path to the cache file for aHasteMapinstancejest-runtime: Remove
cacheDirectoryfromignorePatternforHasteMapif not necessaryjest-validate: Add syntax to validate multiple permitted types
jest-config: Accept an array as as well as a string for
testRegex([#7209]#7209))expect/jest-matcher-utils: Improve report when assertion fails, part 4
expect/jest-matcher-utils: Improve report when assertion fails, part 5
expect: Check constructor equality in .toStrictEqual()
jest-util: Add
jest.getTimerCount()to get the count of scheduled fake timersjest-config: Add
dependencyExtractoroption to use a custom module to extract dependencies from files (#7313, #7349, #7350, #7362)jest-haste-map: Accept a
getCacheKeymethod inhasteImplModulePathmodules to reset the cache when the logic changesjest-config: Add
haste.computeSha1option to compute the sha-1 of the files in the haste mapexpect:
expect(Infinity).toBeCloseTo(Infinity)TreatsInfinityas equal in toBeCloseTo matcherjest-worker: Add node worker-thread support to jest-worker
jest-config: Allow
bailsetting to be configured with a number allowing tests to abort afternof failuresjest-config: Allow % based configuration of
--max-workersjest-runner: Instantiate the test environment class with the current
testPathjest-config: Always resolve jest-environment-jsdom from jest-config
expect: Improve report when assertion fails, part 6
jest-worker: Add
enableWorkerThreadsoption to explicitly opt-in toworker_threadsif available
Fixes
expect: Accept inherited properties in
toHavePropertymatcherjest-diff: Do not claim that
-0and0have no visual differencejest-mock: Fix automock for numeric function names
jest-config: Ensure
existsSyncis only called with a string parameterexpect:
toStrictEqualconsiders sparseness of arrays.jest-cli: Fix empty coverage data for untested files
- breaking
jest-cli: Do not use
text-summarycoverage reporter by default if other reporters are configured - breaking
jest-mock: Fix bugs with mock/spy result tracking of recursive functions
- breaking
jest-haste-map: Recover files correctly after haste name collisions are fixed
- breaking
pretty-format: Omit non-enumerable symbol properties
- breaking
*: Upgrade to Babel 7, dropping support for Babel 6
jest-cli: Avoid watch mode causing bad terminal behavior in some cases
jest-runner/jest-worker: Fix missing console output in verbose mode
expect: Standardize file naming in
expectjest-each: Add empty array validation check
jest-cli: Interrupt tests if interactive watch plugin key is pressed
jest-each: Add each array validation check
jest-haste-map: Do not visit again files with the same sha-1
jest-jasmine2: Fix memory leak in Error objects hold by the framework
jest-haste-map: Fixed Haste whitelist generation for scoped modules on Windows
jest-mock: Fix inheritance of static properties and methods in mocks
jest-mock: Fix mocking objects without
Object.prototypein their prototype chainjest-mock: Check
_isMockFunctionis true rather than truthy on potential mocksjest-cli: Update jest-cli to show git ref in message when using
changedSince[jest-jasmine2] Fix crash when test return Promise rejected with nulljest-runtime: Check
_isMockFunctionis true rather than truthy on potential global mocksjest-jasmine: Show proper error message from async
asserterrorsjest-jasmine2: Better error message when a describe block is empty
jest-jasmine2: Pending calls inside async tests are reported as pending not failed
jest-circus: Better error message when a describe block is empty
jest-jasmine2: Add missing testLocationResults for
xitandfitexpect: Return false from asymmetric matchers if received value isn’t string
jest-cli: Fix unhandled error when a bad revision is provided to
changedSincejest-config: Moved dynamically assigned
cwdfromjest-clito default configuration injest-configjest-config: Fix
getMaxWorkerson termuxjest-runtime: Throw an explicit error if
jsis missing frommoduleFileExtensionsjest-runtime: Fix missing coverage when using negative glob pattern in
testMatch*: Ensure
maxWorkersis at least 1 (was 0 in some cases where there was only 1 CPU)jest-runtime: Fix transform cache invalidation when requiring a test file from multiple projects
jest-changed-files: Return correctly the changed files when using
lastCommit=trueon Mercurial repositoriesbabel-jest: Cache includes babel environment variables
jest-config: Use strings instead of
RegExpinstances in normalized configurationjest-circus: Make sure to display real duration even if time is mocked
expect: Improves the failing message for
toStrictEqualmatcher.expect: Improves the failing message for
toEqualmatcher.jest-resolve: Fix not being able to resolve path to mapped file with custom platform
jest-message-util: Improve parsing of error messages for unusually formatted stack traces
jest-runtime: Ensure error message text is not lost on errors with code frames
jest-haste-map: Fix to resolve path that is start with words same as rootDir
expect: Fix toMatchObject matcher when used with
Object.create(null)jest-haste-map: Remove legacy condition for duplicate module detection
jest-haste-map: Fix
requiredetection with trailing commas and ignoreimport typeofmodulesjest-cli: Fix to set prettierPath via config file
expect: Test more precisely for class instance getters
jest-cli: Support dashed args
jest-cli: Fix to run in band tests if watch mode enable when runInBand arg used
jest-runtime: Fix mistake as test files when run coverage issue.
jest-cli: Print info about passWithNoTests flag
pretty-format: Omit unnecessary symbol filter for object keys
jest-runtime: Fix
requireActualon node_modules with mock presentjest-resolve: Fix
isBuiltinModuleto support versions of node withoutmodule.builtinModulesbabel-jest: Set
cwdto be resilient to it changing during the runtime of the testsjest-snapshot: Write and read snapshots from disk even if
fsis mockedjest-config: Normalize
config.cwdandconfig.rootDirusing `realpathjest-environment-node: Fix buffer property is not ArrayBuffer issue.
babel-plugin-jest-hoist: Ignore TS type annotations when looking for out-of-scope references
jest-config: Add name to project if one does not exist to pick correct resolver
jest-runtime: Pass
watchPathIgnorePatternsto Haste instancejest-runtime: Resolve mock files via Haste when using
require.resolve
Chore & Maintenance
- breaking
*: Require Node.js 6+ for all packages
- breaking
jest-util: Remove long-deprecated globals for fake timers
- breaking
*: Upgrade to Micromatch 3
- breaking
*: Remove regenerator-runtime injection
Performance
jest-mock: Improve
getTypefunction performance.
- 23.x
23.6.0
10 Sep 2018jest-cli: Add
changedSinceto allowed watch mode configsbabel-jest: Add support for
babel.config.jsadded in Babel 7.0.0jest-resolve: Add support for an experimental
mapperoption (Watchman crawler only) that adds virtual files to the Haste map
Features
jest-cli: Add
changedSinceto allowed watch mode configsbabel-jest: Add support for
babel.config.jsadded in Babel 7.0.0jest-resolve: Add support for an experimental
mapperoption (Watchman crawler only) that adds virtual files to the Haste map
Fixes
jest-resolve: Only resolve realpath once in try-catch
expect: Fix TypeError in
toBeInstanceOfonnullorundefinedjest-jasmine2: Throw a descriptive error if the first argument supplied to a hook was not a function (#6917) and
jest-circus: Throw a descriptive error if the first argument supplied to a hook was not a function (#6917) and
expect: Fix variadic custom asymmetric matchers
jest-cli: Fix incorrect
testEnvironmentOptionswarningjest-each: Prevent done callback being supplied to describe
jest-config: Better error message for a case when a preset module was found, but no
jest-preset.jsorjest-preset.jsonat the rootjest-haste-map: Catch crawler error when unsuccessfully reading directories
23.4.2
27 Jul 2018jest-changed-files: Limit git and hg commands to specified roots
jest-circus: Fix retryTimes so errors are reset before re-running
babel-jest: Make
getCacheKey()take into accountcreateTransformeroptions
Performance
jest-changed-files: Limit git and hg commands to specified roots
Fixes
jest-circus: Fix retryTimes so errors are reset before re-running
babel-jest: Make
getCacheKey()take into accountcreateTransformeroptionsjest-jasmine2: Use prettier through
requireinstead oflocalRequire. FixesmatchInlineSnapshotwhere prettier dependencies likepathandfsare mocked withjest.mock.website: Fix website versions page to link to correct language
expect: Update
toContainsuggestion to contain equal message
23.4.0
10 Jul 2018jest-haste-map: Add
computeDependenciesflag to avoid opening files if not neededjest-runtime: Support
require.resolve.pathsjest-runtime: Support
pathsoption forrequire.resolve
Features
jest-haste-map: Add
computeDependenciesflag to avoid opening files if not neededjest-runtime: Support
require.resolve.pathsjest-runtime: Support
pathsoption forrequire.resolve
Fixes
jest-runner: Force parallel runs for watch mode, to avoid TTY freeze
jest-cli: Properly reprint resolver errors in watch mode
jest-cli: Write configuration to stdout when the option was explicitly passed to Jest
jest-cli: Fix regression on non-matching suites (6657)
jest-runtime: Roll back
micromatchversion to prevent regression when matching files
23.2.0
25 Jun 2018jest-each: Add support for keyPaths in test titles
jest-cli: Add
jest --initoption that generates a basic configuration file with a short description for each optionjest.retryTimes: Add
jest.retryTimes()option that allows failed tests to be retried n-times when using jest-circus.
Features
jest-each: Add support for keyPaths in test titles
jest-cli: Add
jest --initoption that generates a basic configuration file with a short description for each optionjest.retryTimes: Add
jest.retryTimes()option that allows failed tests to be retried n-times when using jest-circus.
Fixes
jest-cli: Add check to make sure one or more tests have run before notifying when using
--notifyjest-cli: Pass
globalConfigas a parameter toglobalSetupandglobalTeardownfunctionsjest-config: Add missing options to the
defaultsobjectexpect: Using symbolic property names in arrays no longer causes the
toEqualmatcher to failexpect:
toEqualno longer tries to compare non-enumerable symbolic properties, to be consistent with non-symbolic properties.jest-util:
console.timeEndnow properly log elapsed time in milliseconds.jest-mock: Fix
MockNativeMethodsaccess in react-nativejest.mock()jest-cli: Fix
reportersformoduleName='default'
23.0.1
27 May 2018pretty-format: Serialize inverse asymmetric matchers correctly
Fixes
pretty-format: Serialize inverse asymmetric matchers correctly
23.0.0
24 May 2018- breaking
jest-snapshot: Concatenate name of test, optional snapshot name and count
- breaking
jest-jasmine2: Adds error throwing and descriptive errors to
it/testfor invalid arguments.[jest-circus]Adds error throwing and descriptive errors toit/testfor invalid arguments - breaking
jest-mock: Include tracked call results in serialized mock
Features
expect: Expose
getObjectSubset,iterableEquality, andsubsetEqualityjest-snapshot: Add snapshot property matchers
jest-config: Support jest-preset.js files within Node modules
jest-cli: Add
--detectOpenHandlesflag which enables Jest to potentially track down handles keeping it open after tests are complete.jest-jasmine2: Add data driven testing based on
jest-eachjest-matcher-utils: Change "suggest to equal" message to be more advisory
jest-message-util: Don't ignore messages with
vendoranymorejest-validate: Get rid of
jest-configdependencyjest-validate: Adds option to inject
deprecationEntries- breaking
jest-snapshot: Concatenate name of test, optional snapshot name and count
jest-runtime: Allow for transform plugins to skip the definition process method if createTransformer method was defined.
expect: Add stack trace for async errors
jest-jasmine2: Add stack trace for timeouts
jest-jasmine2: Add stack trace for thrown non-
Errorsjest-runtime: Prevent modules from marking themselves as their own parent
jest-mock: Add support for auto-mocking generator functions
expect: Add support for async matchers
expect: Suggest toContainEqual
jest-config: Export Jest's default options
jest-editor-support: Move
coveragetoProjectWorkspace.collectCoveragejest-editor-support: Add
coverageoption to runnerjest-haste-map: Support extracting dynamic
importsexpect: Improve output format for mismatchedArgs in mock/spy calls.
jest-cli: Add support for using
--coveragein combination with watch mode,--onlyChanged,--findRelatedTestsand more- breaking
jest-jasmine2: Adds error throwing and descriptive errors to
it/testfor invalid arguments.[jest-circus]Adds error throwing and descriptive errors toit/testfor invalid arguments jest-matcher-utils: Add
isNotoption tomatcherHintfunctionjest-config: Add
<rootDir>to runtime files not found error reportexpect: Make toThrow matcher pass only if Error object is returned from promises
expect: Add isError to utils
expect: Add inverse matchers (
expect.not.arrayContaining, etc., #5517)expect:
expect.extendnow also extends asymmetric matchersjest-mock: Update
spyOnPropertyto support spying on the prototype chainjest-mock: Add tracking of return values in the
mockpropertyjest-mock: Add tracking of thrown errors in the
mockpropertyAdd nthCalledWith spy matcher
jest-cli: Add
isSerialproperty that runners can expose to specify that they can not run in parallelexpect: Add
.toBeCalledTimesandtoHaveBeenNthCalledWithaliasesjest-cli: Interactive Snapshot Mode improvements
jest-editor-support: Add
no-coloroption to runnerjest-jasmine2: Pretty-print non-Error object errors
jest-message-util: Include column in stack frames
expect: Introduce toStrictEqual
expect: Add return matchers
jest-cli: Improve snapshot summaries
expect: Include custom mock names in error messages
jest-diff: Support returning diff from oneline strings
expect: Improve return matchers
jest-cli: Overhaul watch plugin hooks names
- breaking
jest-mock: Include tracked call results in serialized mock
Fixes
jest-cli: Fix stdin encoding to utf8 for watch plugins.
expect: Better detection of DOM Nodes for equality
jest-cli: Fix misleading action description for F key when in "only failed tests" mode.
jest-worker: Stick calls to workers before processing them
babel-plugin-jest-hoist: Allow using
consoleglobal variablejest-jasmine2: Always remove node core message from assert stack traces
expect: Add stack trace when
expect.assertionsandexpect.hasAssertionscauses test failures.jest-runtime: Throw a more useful error when trying to require modules after the test environment is torn down
- breaking
jest-mock: Replace timestamps with
invocationCallOrder jest-jasmine2: Install
sourcemap-supportinto normal runtime to catch runtime errorsjest-jasmine2: Added assertion error handling inside
afterAll hookjest-cli: Remove the notifier actions in case of failure when not in watch mode.
jest-mock: Extend .toHaveBeenCalled return message with outcome
jest-runner: Assign
process.env.JEST_WORKER_ID="1"when in runInBand modejest-cli: Add descriptive error message when trying to use
globalSetup/globalTeardownfile that doesn't export a function.expect: Do not rely on
instanceof RegExp, since it will not work for RegExps created inside of a different VMjest-resolve: Update node module resolution algorithm to correctly handle symlinked paths
jest-editor-support: Update
Settingsto use spawn in shell optionjest-cli: Improve the error message when 2 projects resolve to the same config
jest-runtime: Remove retainLines from coverage instrumentation
jest-cli: Fix update snapshot issue when using watchAll
expect: Fix rejects.not matcher
jest-runtime: Prevent Babel warnings on large files
jest-mock: Prevent
mockRejectedValuefrom causing unhandled rejectionpretty-format: Handle React fragments better
pretty-format: Handle formatting of
React.forwardRefandContextcomponentsjest-cli: Switch collectCoverageFrom back to a string
jest-regex-util: Fix handling regex symbols in tests path on Windows
jest-util: Fix handling of NaN/Infinity in mock timer delay
jest-resolve: Generalise test for package main entries equivalent to ".".
jest-config: Ensure that custom resolvers are used when resolving the configuration
website: Fix website docs
expect: Fix isEqual Set and Map to compare object values and keys regardless of order
- breaking
pretty-format: Remove undefined props from React elements
jest-haste-map: Properly resolve mocked node modules without package.json defined
Chore & Maintenance
- breaking
babel-jest: Always return object from transformer
- breaking
jest-runtime: Remove
jest.genMockFnandjest.genMockFunction
- 22.x
22.4.1
22 Feb 2018- removed
babel-jest: Remove
retainLinesargument to babel. jest-haste-map: Parallelize Watchman calls in crawler
jest-editor-support: Update TypeScript definitions
Fixes
jest-haste-map: Parallelize Watchman calls in crawler
jest-editor-support: Update TypeScript definitions
- removed
babel-jest: Remove
retainLinesargument to babel.
Features
jest-runtime: Provide
require.mainproperty set to module with test suite
22.4.0
20 Feb 2018- deprecated
jest-runtime: Deprecate mapCoverage option.
jest-haste-map: Overhauls how Watchman crawler works fixing Windows
expect: Allow matching of Errors against plain objects
Fixes
jest-haste-map: Overhauls how Watchman crawler works fixing Windows
expect: Allow matching of Errors against plain objects
jest-haste-map: Do not read binary files in Haste, even when instructed to do so
jest-cli: Don't skip matchers for exact files
jest-runtime: Align handling of testRegex on Windows between searching for tests and instrumentation checks
jest-config: Make it possible to merge
transformoption with presetjest-util: Fix
console.assertbehavior in custom & buffered consoles
Features
- deprecated
jest-runtime: Deprecate mapCoverage option.
babel-jest: Add option to return sourcemap from the transformer separately from source.
jest-validate: Add ability to log deprecation warnings for CLI flags.
jest-serializer: Added new module for serializing. Works using V8 or JSON
22.2.2
9 Feb 2018babel-jest: Revert "Remove retainLines from babel-jest"
jest-docblock: Support multiple of the same
@pragma.jest-worker: Assign a unique id for each worker and pass it to the child process. It will be available via
process.env.JEST_WORKER_ID
Fixes
babel-jest: Revert "Remove retainLines from babel-jest"
jest-docblock: Support multiple of the same
@pragma.
Features
jest-worker: Assign a unique id for each worker and pass it to the child process. It will be available via
process.env.JEST_WORKER_ID
22.2.0
7 Feb 2018jest-runner: Move test summary to after coverage report
jest-cli: Added
--notifyModeto specify when to be notified.diff-sequences: New package compares items in two sequences to find a longest common subsequence.
Features
jest-runner: Move test summary to after coverage report
jest-cli: Added
--notifyModeto specify when to be notified.diff-sequences: New package compares items in two sequences to find a longest common subsequence.
jest-matcher-utils: Add
commentoption tomatcherHintfunctionjest-config: Allow lastComit and changedFilesWithAncestor via JSON config
jest-util: Add deletion to
process.envas welljest-util: Add case-insensitive getters/setters to
process.envjest-mock: Add util methods to create async functions.
Fixes
jest-cli: Add trailing slash when checking root folder
jest-cli: Hide interactive mode if there are no failed snapshot tests
babel-jest: Remove retainLines from babel-jest
jest-cli: Glob patterns ignore non-
require-able files (e.g.README.md)jest-mock: Add backticks support (``) to
mocka certain package via the__mocks__folder.jest-message-util: Prevent an
ENOENTcrash when the test file contained a malformed source-map. (#5405).jest: Add
import-localtojestpackage.expect: Support class instances in
.toHaveProperty()and.toMatchObjectmatcher.jest-cli: Fix npm update command for snapshot summary. (#5376, 5389)
expect: Make
rejectsandresolvessynchronously validate its argument.jest-resolve: Search required modules in node_modules and then in custom paths.
jest-resolve: Get builtin modules from node core.
jest-resolve: Detect and preserve absolute paths in
moduleDirectories. Do not generate additional (invalid) paths by prepending each ancestor ofcwdto the absolute path. Additionally, this fixes functionality in Windows OS.
22.1.0
15 Jan 2018jest-cli: Make Jest exit without an error when no tests are found in the case of
--lastCommit,--findRelatedTests, or--onlyChangedoptions having been passed to the CLIjest-cli: Add interactive snapshot mode
jest-cli: Use
import-localto support global Jest installations.
Features
jest-cli: Make Jest exit without an error when no tests are found in the case of
--lastCommit,--findRelatedTests, or--onlyChangedoptions having been passed to the CLIjest-cli: Add interactive snapshot mode
Fixes
jest-cli: Use
import-localto support global Jest installations.jest-runner: Fix memory leak in coverage reporting
jest-cli: Fix missing newline in console message
jest-cli:
--lastCommitand--changedFilesWithAncestornow take effect even when--onlyChangedis not specified.
22.0.6
11 Jan 201822.0.4
22 Dec 2017jest-cli: New line before quitting watch mode.
babel-jest: moduleFileExtensions not passed to babel transformer.
Fixes
jest-cli: New line before quitting watch mode.
Features
babel-jest: moduleFileExtensions not passed to babel transformer.
22.0.1
18 Dec 2017jest-runtime: Fix error for test files providing coverage.
jest-config: Add
forceCoverageMatchto allow collecting coverage from ignored files.
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.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.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.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.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.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.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.1.0
1 Aug 2016Changed Jest's default cache directory.
Fixed
jest-react-nativefor react 15.3.0.Updated react and react-native example to use
react-test-renderer.
Changed Jest's default cache directory.
Fixed
jest-react-nativefor react 15.3.0.Updated react and react-native example to use
react-test-renderer.Started to refactor code coverage.
14.0.2
29 Jul 2016babel-jestbugfix.
14.0.1
29 Jul 2016babel-jestcan now be used to compose a transformer.Updated snapshot instructions to run
jest -uornpm test -- -u.Fixed
configcli option to enable JSON objects as configuration.
babel-jestcan now be used to compose a transformer.Updated snapshot instructions to run
jest -uornpm test -- -u.Fixed
configcli option to enable JSON objects as configuration.Updated printing of preset path in the CLI.
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.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
10.0.2
11 Apr 2016