pretty-format
Advanced tools
Changelog
23.0.0
[expect]
Expose getObjectSubset
, iterableEquality
, and subsetEquality
(#6210)[jest-snapshot]
Add snapshot property matchers (#6210)[jest-config]
Support jest-preset.js files within Node modules (#6185)[jest-cli]
Add --detectOpenHandles
flag which enables Jest to potentially track down handles keeping it open after tests are complete. (#6130)[jest-jasmine2]
Add data driven testing based on jest-each
(#6102)[jest-matcher-utils]
Change "suggest to equal" message to be more advisory (#6103)[jest-message-util]
Don't ignore messages with vendor
anymore (#6117)[jest-validate]
Get rid of jest-config
dependency (#6067)[jest-validate]
Adds option to inject deprecationEntries
(#6067)[jest-snapshot]
[BREAKING] Concatenate name of test, optional snapshot name and count (#6015)[jest-runtime]
Allow for transform plugins to skip the definition process method if createTransformer method was defined. (#5999)[expect]
Add stack trace for async errors (#6008)[jest-jasmine2]
Add stack trace for timeouts (#6008)[jest-jasmine2]
Add stack trace for thrown non-Error
s (#6008)[jest-runtime]
Prevent modules from marking themselves as their own parent (#5235)[jest-mock]
Add support for auto-mocking generator functions (#5983)[expect]
Add support for async matchers (#5919)[expect]
Suggest toContainEqual (#5953)[jest-config]
Export Jest's default options (#5948)[jest-editor-support]
Move coverage
to ProjectWorkspace.collectCoverage
(#5929)[jest-editor-support]
Add coverage
option to runner (#5836)[jest-haste-map]
Support extracting dynamic import
s (#5883)[expect]
Improve output format for mismatchedArgs in mock/spy calls. (#5846)[jest-cli]
Add support for using --coverage
in combination with watch mode, --onlyChanged
, --findRelatedTests
and more (#5601)[jest-jasmine2]
[BREAKING] Adds error throwing and descriptive errors to it
/ test
for invalid arguments. [jest-circus]
Adds error throwing and descriptive errors to it
/ test
for invalid arguments (#5558)[jest-matcher-utils]
Add isNot
option to matcherHint
function (#5512)[jest-config]
Add <rootDir>
to runtime files not found error report (#5693)[expect]
Make toThrow matcher pass only if Error object is returned from promises (#5670)[expect]
Add isError to utils (#5670)[expect]
Add inverse matchers (expect.not.arrayContaining
, etc., #5517)[expect]
expect.extend
now also extends asymmetric matchers (#5503)[jest-mock]
Update spyOnProperty
to support spying on the prototype chain (#5753)[jest-mock]
Add tracking of return values in the mock
property (#5752)[jest-mock]
Add tracking of thrown errors in the mock
property (#5764)[expect]
Add nthCalledWith spy matcher (#5605)[jest-cli]
Add isSerial
property that runners can expose to specify that they can not run in parallel (#5706)[expect]
Add .toBeCalledTimes
and toHaveBeenNthCalledWith
aliases (#5826)[jest-cli]
Interactive Snapshot Mode improvements (#5864)[jest-editor-support]
Add no-color
option to runner (#5909)[jest-jasmine2]
Pretty-print non-Error object errors (#5980)[jest-message-util]
Include column in stack frames (#5889)[expect]
Introduce toStrictEqual (#6032)[expect]
Add return matchers (#5879)[jest-cli]
Improve snapshot summaries (#6181)[expect]
Include custom mock names in error messages (#6199)[jest-diff]
Support returning diff from oneline strings (#6221)[expect]
Improve return matchers (#6172)[jest-cli]
Overhaul watch plugin hooks names (#6249)[jest-mock]
[BREAKING] Include tracked call results in serialized mock (#6244)[jest-cli]
Fix stdin encoding to utf8 for watch plugins. (#6253)[expect]
Better detection of DOM Nodes for equality (#6246)[jest-cli]
Fix misleading action description for F key when in "only failed tests" mode. (#6167)[jest-worker]
Stick calls to workers before processing them (#6073)[babel-plugin-jest-hoist]
Allow using console
global variable (#6075)[jest-jasmine2]
Always remove node core message from assert stack traces (#6055)[expect]
Add stack trace when expect.assertions
and expect.hasAssertions
causes test failures. (#5997)[jest-runtime]
Throw a more useful error when trying to require modules after the test environment is torn down (#5888)[jest-mock]
[BREAKING] Replace timestamps with invocationCallOrder
(#5867)[jest-jasmine2]
Install sourcemap-support
into normal runtime to catch runtime errors (#5945)[jest-jasmine2]
Added assertion error handling inside afterAll hook
(#5884)[jest-cli]
Remove the notifier actions in case of failure when not in watch mode. (#5861)[jest-mock]
Extend .toHaveBeenCalled return message with outcome (#5951)[jest-runner]
Assign process.env.JEST_WORKER_ID="1"
when in runInBand mode (#5860)[jest-cli]
Add descriptive error message when trying to use globalSetup
/globalTeardown
file that doesn't export a function. (#5835)[expect]
Do not rely on instanceof RegExp
, since it will not work for RegExps created inside of a different VM (#5729)[jest-resolve]
Update node module resolution algorithm to correctly handle symlinked paths (#5085)[jest-editor-support]
Update Settings
to use spawn in shell option (#5658)[jest-cli]
Improve the error message when 2 projects resolve to the same config (#5674)[jest-runtime]
remove retainLines from coverage instrumentation (#5692)[jest-cli]
Fix update snapshot issue when using watchAll (#5696)[expect]
Fix rejects.not matcher (#5670)[jest-runtime]
Prevent Babel warnings on large files (#5702)[jest-mock]
Prevent mockRejectedValue
from causing unhandled rejection (#5720)[pretty-format]
Handle React fragments better (#5816)[pretty-format]
Handle formatting of React.forwardRef
and Context
components (#6093)[jest-cli]
Switch collectCoverageFrom back to a string (#5914)[jest-regex-util]
Fix handling regex symbols in tests path on Windows (#5941)[jest-util]
Fix handling of NaN/Infinity in mock timer delay (#5966)[jest-resolve]
Generalise test for package main entries equivalent to ".". (#5968)[jest-config]
Ensure that custom resolvers are used when resolving the configuration (#5976)[website]
Fix website docs (#5853)[expect]
Fix isEqual Set and Map to compare object values and keys regardless of order (#6150)[pretty-format]
[BREAKING] Remove undefined props from React elements (#6162)[jest-haste-map]
Properly resolve mocked node modules without package.json defined (#6232)[jest-runner]
Move sourcemap installation from jest-jasmine2
to jest-runner
(#6176)[jest-cli]
Use yargs's built-in version
instead of rolling our own (#6215)[docs]
Add explanation on how to mock methods not implemented in JSDOM[jest-jasmine2]
Simplify Env.execute
and TreeProcessor to setup and clean resources for the top suite the same way as for all of the children suites (#5885)[babel-jest]
[BREAKING] Always return object from transformer (#5991)[*]
Run Prettier on compiled output (#5858)[jest-cli]
Add fileChange hook for plugins (#5708)[docs]
Add docs on using jest.mock(...)
(#5648)[docs]
Mention Jest Puppeteer Preset (#5722)[docs]
Add jest-community section to website (#5675)[docs]
Add versioned docs for v22.4 (#5733)[docs]
Improve Snapshot Testing Guide (#5812)[jest-runtime]
[BREAKING] Remove jest.genMockFn
and jest.genMockFunction
(#6173)[jest-message-util]
Avoid adding unnecessary indent to blank lines in stack traces (#6211)Changelog
jest 22.1.0
[jest-cli]
Make Jest exit without an error when no tests are found in the case of --lastCommit
, --findRelatedTests
, or --onlyChanged
options having been passed to the CLI[jest-cli]
Add interactive snapshot mode (#3831)[jest-cli]
Use import-local
to support global Jest installations. (#5304)[jest-runner]
Fix memory leak in coverage reporting (#5289)[docs]
Update mention of the minimal version of node supported (#4947)[jest-cli]
Fix missing newline in console message (#5308)[jest-cli]
--lastCommit
and --changedFilesWithAncestor
now take effect even when --onlyChanged
is not specified. (#5307)[filenames]
Standardize folder names under integration-tests/
(#5298)Changelog
jest 22.0.0
[jest-resolve]
Use module.builtinModules
as BUILTIN_MODULES
when it exists[jest-worker]
Remove debug
and inspect
flags from the arguments sent to the child (#5068)[jest-config]
Use all --testPathPattern
and <regexForTestFiles>
args in testPathPattern
(#5066)[jest-cli]
Do not support --watch
inside non-version-controlled environments (#5060)[jest-config]
Escape Windows path separator in testPathPattern CLI arguments (#5054)[jest-jasmine]
Register sourcemaps as node environment to improve performance with jsdom (#5045)[pretty-format]
Do not call toJSON recursively (#5044)[pretty-format]
Fix errors when identity-obj-proxy mocks CSS Modules (#4935)[babel-jest]
Fix support for namespaced babel version 7 (#4918)[expect]
fix .toThrow for promises (#4884)[jest-docblock]
pragmas should preserve urls (#4837)[jest-cli]
Check if npm_lifecycle_script
calls Jest directly (#4629)[jest-cli]
Fix --showConfig to show all configs (#4494)[jest-cli]
Throw if maxWorkers
doesn't have a value (#4591)[jest-cli]
Use fs.realpathSync.native
if available (#5031)[jest-config]
Fix --passWithNoTests
(#4639)[jest-config]
Support rootDir
tag in testEnvironment (#4579)[jest-editor-support]
Fix --showConfig
to support jest 20 and jest 21 (#4575)[jest-editor-support]
Fix editor support test for node 4 (#4640)[jest-mock]
Support mocking constructor in mockImplementationOnce
(#4599)[jest-runtime]
Fix manual user mocks not working with custom resolver (#4489)[jest-util]
Fix runOnlyPendingTimers
for setTimeout
inside setImmediate
(#4608)[jest-message-util]
Always remove node internals from stacktraces (#4695)[jest-resolve]
changes method of determining builtin modules to include missing builtins (#4740)[pretty-format]
Prevent error in pretty-format for window in jsdom test env (#4750)[jest-resolve]
Preserve module identity for symlinks (#4761)[jest-config]
Include error message for preset
json (#4766)[pretty-format]
Throw PrettyFormatPluginError
if a plugin halts with an exception (#4787)[expect]
Keep the stack trace unchanged when PrettyFormatPluginError
is thrown by pretty-format (#4787)[jest-environment-jsdom]
Fix asynchronous test will fail due to timeout issue. (#4669)[jest-cli]
Fix --onlyChanged
path case sensitivity on Windows platform (#4730)[jest-runtime]
Use realpath to match transformers (#5000)[expect]
[BREAKING] Replace identity equality with Object.is in toBe matcher (#4917)[jest-message-util]
Add codeframe to test assertion failures (#5087)[jest-config]
Add Global Setup/Teardown options (#4716)[jest-config]
Add testEnvironmentOptions
to apply to jsdom options or node context. (#5003)[jest-jasmine2]
Update Timeout error message to jest.timeout
and display current timeout value (#4990)[jest-runner]
Enable experimental detection of leaked contexts (#4895)[jest-cli]
Add combined coverage threshold for directories. (#4885)[jest-mock]
Add timestamps
to mock state. (#4866)[eslint-plugin-jest]
Add prefer-to-have-length
lint rule. (#4771)[jest-environment-jsdom]
[BREAKING] Upgrade to JSDOM@11 (#4770)[jest-environment-*]
[BREAKING] Add Async Test Environment APIs, dispose is now teardown (#4506)[jest-cli]
Add an option to clear the cache (#4430)[babel-plugin-jest-hoist]
Improve error message, that the second argument of jest.mock
must be an inline function (#4593)[jest-snapshot]
[BREAKING] Concatenate name of test and snapshot (#4460)[jest-cli]
[BREAKING] Fail if no tests are found (#3672)[jest-diff]
Highlight only last of odd length leading spaces (#4558)[jest-docblock]
Add docblock.print()
(#4517)[jest-docblock]
Add strip
(#4571)[jest-docblock]
Preserve leading whitespace in docblock comments (#4576)[jest-docblock]
remove leading newlines from parswWithComments().comments
(#4610)[jest-editor-support]
Add Snapshots metadata (#4570)[jest-editor-support]
Adds an 'any' to the typedef for updateFileWithJestStatus
(#4636)[jest-editor-support]
Better monorepo support (#4572)[jest-environment-jsdom]
Add simple rAF polyfill in jsdom environment to work with React 16 (#4568)[jest-environment-node]
Implement node Timer api (#4622)[jest-jasmine2]
Add testPath to reporter callbacks (#4594)[jest-mock]
Added support for naming mocked functions with .mockName(value)
and .mockGetName()
(#4586)[jest-runtime]
Add module.loaded
, and make module.require
not enumerable (#4623)[jest-runtime]
Add module.parent
(#4614)[jest-runtime]
Support sourcemaps in transformers (#3458)[jest-snapshot]
[BREAKING] Add a serializer for jest.fn
to allow a snapshot of a jest mock (#4668)[jest-worker]
Initial version of parallel worker abstraction, say hello! (#4497)[jest-jasmine2]
Add testLocationInResults
flag to add location information per spec to test results (#4782)[jest-environment-jsdom]
Update JSOM to 11.4, which includes built-in support for requestAnimationFrame
(#4919)[jest-cli]
Hide watch usage output when running on non-interactive environments (#4958)[jest-snapshot]
Promises support for toThrowErrorMatchingSnapshot
(#4946)[jest-cli]
Explain which snapshots are obsolete (#5005)[docs]
Add guide of using with puppeteer (#5093)[jest-util]
jest-util
should not depend on jest-mock
(#4992)[*]
[BREAKING] Drop support for Node.js version 4 (#4769)[docs]
Wrap code comments at 80 characters (#4781)[eslint-plugin-jest]
Removed from the Jest core repo, and moved to https://github.com/jest-community/eslint-plugin-jest (#4867)[babel-jest]
Explicitly bump istanbul to newer versions (#4616)[expect]
Upgrade mocha and rollup for browser testing (#4642)[docs]
Add info about coveragePathIgnorePatterns
(#4602)[docs]
Add Vuejs series of testing with Jest (#4648)[docs]
Mention about optional done
argument in test function (#4556)[jest-cli]
Bump node-notifier version (#4609)[jest-diff]
Simplify highlight for leading and trailing spaces (#4553)[jest-get-type]
Add support for date (#4621)[jest-matcher-utils]
Call chalk.inverse
for trailing spaces (#4578)[jest-runtime]
Add .advanceTimersByTime
; keep .runTimersToTime()
as an alias.[docs]
Include missing dependency in TestEnvironment sample code[docs]
Add clarification for hook execution order[docs]
Update expect.anything()
sample code (#5007)Changelog
jest 21.2.0
--silent --verbose
problem (#4505)Changelog
jest 21.1.0
Changelog
jest 21.0.0
Add --changedFilesWithAncestor (#4070)
Add --findRelatedFiles (#4131)
Add --onlyChanged tests (#3977)
Add contextLines
option to jest-diff (#4152)
Add alternative serialize API for pretty-format plugins (#4114)
Add displayName to MPR (#4327)
Add displayName to TestResult (#4408)
Add es5 build of pretty-format (#4075)
Add extra info to no tests for changed files message (#4188)
Add fake chalk in browser builds in order to support IE10 (#4367)
Add jest.requireActual (#4260)
Add maxWorkers to globalConfig (#4005)
Add skipped tests support for jest-editor-support (#4346)
Add source map support for better debugging experience (#3738)
Add support for Error objects in toMatchObject (#4339)
Add support for Immutable.Record in pretty-format (#3678)
Add tests for extract_requires on export types (#4080)
Add that toMatchObject can match arrays (#3994)
Add watchPathIgnorePatterns to exclude paths to trigger test re-run in watch mode (#4331)
Adding ancestorTitles property to JSON test output (#4293)
Allow custom resolver to be used with[out] moduleNameMapper (#4174)
Avoid parsing .require(…)
method calls (#3777)
Avoid unnecessary function declarations and call in pretty-format (#3962)
Avoid writing to stdout in default reporter if --json is enabled. Fixes #3941 (#3945)
Better error handling for --config (#4230)
Call consistent pretty-format plugins within Jest (#3800)
Change babel-core to peerDependency for compatibility with Babel 7 (#4162)
Change Promise detection code in jest-circus to support non-global Promise implementations (#4375)
Changed files eager loading (#3979)
Check whether we should output to stdout or stderr (#3953)
Clarify what objects toContain and toContainEqual can be used on (#4307)
Clean up resolve() logic. Provide useful names for variables and functions. Test that a directory exists before attempting to resolve files within it. (#4325)
cleanupStackTrace (#3696)
compare objects with Symbol keys (#3437)
Complain if expect is passed multiple arguments (#4237)
Completes nodeCrawl with empty roots (#3776)
Consistent naming of files (#3798)
Convert code base to ESM import (#3778)
Correct summary message for flag --findRelatedTests. (#4309)
Coverage thresholds can be set up for individual files (#4185)
custom reporter error handling (#4051)
Define separate type for pretty-format plugin Options (#3802)
Delete confusing async keyword (#3679)
Delete redundant branch in ReactElement and HTMLElement plugins (#3731)
Don't format node assert errors when there's no 'assert' module (#4376)
Don't print test summary in --silent (#4106)
Don't try to build ghost packages (#3934)
Escape double quotes in attribute values in HTMLElement plugin (#3797)
Explain how to clear the cache (#4232)
Factor out common code for collections in pretty-format (#4184)
Factor out common code for markup in React plugins (#4171)
Feature/internal resolve (#4315)
Fix --logHeapUsage (#4176)
Fix --showConfig to show all project configs (#4078)
Fix --watchAll (#4254)
Fix bug when setTimeout is mocked (#3769)
Fix changedFilesWithAncestor (#4193)
Fix colors for expected/stored snapshot message (#3702)
Fix concurrent test failure (#4159)
Fix for 4286: Compare Maps and Sets by value rather than order (#4303)
fix forceExit (#4105)
Fix grammar in React Native docs (#3838)
Fix inconsistent name of complex values in pretty-format (#4001)
Fix issue mocking bound method (#3805)
Fix jest-circus (#4290)
Fix lint warning in main
(#4132)
Fix linting (#3946)
fix merge conflict (#4144)
Fix minor typo (#3729)
fix missing console.log messages (#3895)
fix mock return value (#3933)
Fix mocking for modules with folders on windows (#4238)
Fix NODE_PATH resolving for relative paths (#3616)
Fix options.moduleNameMapper override order with preset (#3565 (#3689)
Fix React PropTypes warning in tests for Immutable plugin (#4412)
Fix regression in mockReturnValueOnce (#3857)
Fix sample code of mock class constructors (#4115)
Fix setup-test-framework-test (#3773)
fix typescript jest test crash (#4363)
Fix watch mode (#4084)
Fix Watchman on windows (#4018)
Fix(babel): Handle ignored files in babel v7 (#4393)
Fix(babel): Support upcoming beta (#4403)
Fixed object matcher (#3799)
Fixes #3820 use extractExpectedAssertionsErrors in jasmine setup
Flow upgrade (#4355)
Force message in matchers to always be a function (#3972)
Format describe
and use test
instead of it
alias (#3792)
global_config.js for multi-project runner (#4023)
Handle async errors (#4016)
Hard-fail if hasteImpl is throwing an error during initialization. (#3812)
Ignore import type for extract_requires (#4079)
Ignore indentation of data structures in jest-diff (#3429)
Implement 'jest.requireMock' (#4292)
Improve Jest phabricator plugin (#4195)
Improve Seq and remove newline from non-min empty in Immutable plugin (#4241)
Improved the jest reporter with snapshot info per test. (#3660)
Include fullName in formattedAssertion (#4273)
Integrated with Yarn workspaces (#3906)
jest --all (#4020)
jest-circus test failures (#3770)
jest-circus Timeouts (#3760)
jest-haste-map: add test case for broken handling of ignore pattern (#4047)
jest-haste-map: add test+fix for broken platform module support (#3885)
jest-haste-map: deprecate functional ignorePattern and use it in cache key (#4063)
jest-haste-map: mock 'fs' with more idiomatic jest.mock() (#4046)
jest-haste-map: only file IO errors should be silently ignored (#3816)
jest-haste-map: throw when trying to get a duplicated module (#3976)
jest-haste-map: watchman crawler: normalize paths (#3887)
jest-runtime: atomic cache write, and check validity of data (#4088)
Join lines with newline in jest-diff (#4314)
Keep ARGV only in CLI files (#4012)
let transformers adjust cache key based on mapCoverage (#4187)
Lift requires (#3780)
Log stack when reporting errors in jest-runtime (#3833)
Make --listTests return a new line separated list when not using --json (#4229)
Make build script printing small-terminals-friendly (#3892)
Make error messages more explicit for toBeCalledWith assertions (#3913)
Make jest-matcher-utils use ESM exports (#4342)
Make jest-runner a standalone package. (#4236)
Make Jest’s Test Runner configurable. (#4240)
Make listTests always print to console.log (#4391)
Make providesModuleNodeModules ignore nested node_modules directories
Make sure function mocks match original arity (#4170)
Make sure runAllTimers also clears all ticks (#3915)
Make toBe matcher error message more helpful for objects and arrays (#4277)
Make useRealTimers play well with timers: fake (#3858)
Move getType from jest-matcher-utils to separate package (#3559)
Multiroot jest-change-files (#3969)
Output created snapshot when using --ci option (#3693)
Point out you can use matchers in .toMatchObject (#3796)
Prevent babelrc package import failure on relative current path (#3723)
Print RDP details for windows builds (#4017)
Provide better error checking for transformed content (#3807)
Provide printText and printComment in markup.js for HTMLElement plugin (#4344)
Provide regex visualization for testRegex (#3758)
Refactor CLI (#3862)
Refactor names and delimiters of complex values in pretty-format (#3986)
Replace concat(Immutable) with Immutable as item of plugins array (#4207)
Replace Jasmine with jest-circus (#3668)
Replace match with test and omit redundant String conversion (#4311)
Replace print with serialize in AsymmetricMatcher plugin (#4173)
Replace print with serialize in ConvertAnsi plugin (#4225)
Replace print with serialize in HTMLElement plugin (#4215)
Replace print with serialize in Immutable plugins (#4189)
Replace unchanging args with one config arg within pretty-format (#4076)
Return UNDEFINED for undefined type in ReactElement plugin (#4360)
Rewrite some read bumps in pretty-format (#4093)
Run update method before installing JRE on Circle (#4318)
Separated the snapshot summary creation from the printing to improve testability. (#4373)
Set coverageDirectory during normalize phase (#3966)
Setup custom reporters after default reporters (#4053)
Setup for Circle 2 (#4149)
Simplify readme (#3790)
Simplify snapshots definition (#3791)
skipNodeResolution config option (#3987)
Small fixes to toHaveProperty docs (#3878)
Sort attributes by name in HTMLElement plugin (#3783)
Specify watchPathIgnorePatterns will only be available in Jest 21+ (#4398)
Split TestRunner off of TestScheduler (#4233)
Strict and explicit config resolution logic (#4122)
Support maxDepth option in React plugins (#4208)
Support SVG elements in HTMLElement plugin (#4335)
Test empty Immutable collections with {min: false} option (#4121)
test to debug travis failure in main (#4145)
testPathPattern message test (#4006)
Throw Error When Using Nested It Specs (#4039)
Throw when moduleNameMapper points to inexistent module (#3567)
Unified 'no tests found' message for non-verbose MPR (#4354)
Update migration guide with jest-codemods transformers (#4306)
Use "inputSourceMap" for coverage re-mapping. (#4009)
Use "verbose" no test found message when there is only one project (#4378)
Use babel transform to inline all requires (#4340)
Use eslint plugins to run prettier (#3971)
Use iterableEquality in spy matchers (#3651)
Use modern HTML5 <!DOCTYPE> (#3937)
Wrap Error.captureStackTrace
in a try (#4035)