jest-config
Advanced tools
Changelog
jest 19.0.0
mocksPattern
configuration option, it never worked correctly.testPathDirs
to roots
to avoid confusion when configuring Jest.babel-plugin-jest-hoist
to work properly with type annotations in tests.toMatchObject
.--bail
behavior.babel-jest
plugin: babel is loaded lazily, istanbul comments are only added when coverage is used.--collectCoverageFrom
cli argument.--coverageDirectory
cli argument.expect.addSnapshotSerializer
to add custom snapshot serializers for tests.jest.spyOn
.testMatch
configuration option that accepts glob patterns.__mocks__/react-native/Library/Text.js
will now work as expected.--notify
.Changelog
jest 18.1.0
context
variable.-h
as alias for --help
.Changelog
jest 18.0.0
See https://jestjs.io/blog/2016/12/15/2016-in-jest
pit
and mockImpl
. Use it
or mockImplementation
instead.--bail
is used together with --watch
.pretty-format
is now merged into Jest.require('v8')
now works properly in a test context.expect.any
, expect.anything
, expect.objectContaining
, expect.arrayContaining
, expect.stringMatching
.snapshotSerializers
, setupFiles
, transform
, testRunner
and testResultsProcessor
instead of using path.resolve
.--testResultsProcessor
is now exposed through the cli.--jsonOutputFile
to --outputFile
.jest-editor-support
for vscode and Nuclide integration.test.concurrent
unhandled promise rejections.testRegex
to include test.js
and spec.js
files.babel-plugin-jest-hoist
when using jest.mock
with three arguments.JSON
global in jest-environment-node
now comes from the vm context instead of the parent context.FakeTimers.useTimers()
is called.JEST_HIDE_USAGE
.expect.assertions(number)
which will ensure that a specified amount of assertions is made in one test..toMatchSnapshot(?string)
feature to give snapshots a name.jest-react-native
was deprecated and now forwards react-native
..toMatchObject
matcher.NaN% Failed
in the OS notification when using --notify
..toHaveProperty
matcher.Map
/Set
comparisons.test.concurrent
now works with --testNamePattern
.Changelog
jest 17.0.3
.toHaveLength
matcher..toContain
matcher.Changelog
jest 17.0.1
.native.js
files in react-native projects.Changelog
jest 17.0.0
expect.extend
.--expand
(or -e
) to show the full diff.scriptPreprocessor
with the new transform
option.jest.resetAllMocks
which replaces jest.clearAllMocks
.jest-environment-node
..babelrc
is now part of the transform cache key in babel-jest
.jest-haste-map
.--json
now includes information about individual tests inside a file.