Type object
File match jest.config.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/jest/latest.json
Source https://www.schemastore.org/jest.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

automock boolean

Whether all imported modules in your tests should be mocked automatically. All modules used in your tests will have a replacement implementation, keeping the API surface.

Default: false
bail boolean | number

How many failures until jest stops running. Value of true is equivalent to 1.

Default: 0
cacheDirectory string

The directory where Jest should store its cached dependency information.

clearMocks boolean

Whether to automatically clear mock calls and instances between every test.

Default: false
collectCoverage boolean

Whether to collect coverage information while executing the test

Default: false
collectCoverageFrom string[]

An array of glob patterns indicating a set of files for which coverage information should be collected.

coverageDirectory string

The directory where Jest should output its coverage files.

coveragePathIgnorePatterns string[]

An array of regexp pattern strings that will be ignored when calculating coverage

Default:
[
  "/node_modules/"
]
coverageProvider string

Indicates which provider should be used to instrument code for coverage.

Default: "babel"
Values: "babel" "v8"
coverageReporters string | array[]

A list of reporter names that Jest uses when writing coverage reports.

Default:
[
  "clover",
  "json",
  "lcov",
  "text"
]
coverageThreshold object

An object that configures minimum threshold enforcement for coverage results.

dependencyExtractor string

Enable the use of a custom dependency extractor.

displayName string | object

A custom label that is printed alongside a test while it is running.

errorOnDeprecated boolean

Whether calling deprecated APIs should throw an error.

Default: false
extensionsToTreatAsEsm string[]

Files extensions that Jest should treat as ESM.

Default:
[]
fakeTimers object

Customize the behavior of fake timers.

Default:
{}
forceCoverageMatch string[]

A list of regexp strings are added to code coverage; this overrides any previous ignored file patterns

Default:
[
  ""
]
globals object

A set of global variables that need to be available in all test environments.

Default:
{}
globalSetup string

Use a custom global setup module to setup the global environment.

globalTeardown string

Use a custom global teardown module to teardown the global environment.

haste object

Customize jest-haste-map, Jest's internal file crawler/cache system

9 nested properties
computeSha1 boolean

Whether to hash functions using SHA1

defaultPlatform string | null

The default platform

forceNodeFilesystemAPI boolean

Whether to use Node's filesystem API instead of shelling out to find

enableSymlinks boolean

Whether to follow symlinks when crawling the filesystem. This option cannot be used in projects that use watachman.

hasteImplModulePath string

Path to a custom implementation of Haste.

platforms string[]

A list of platforms to target.

throwOnModuleCollision boolean

Whether to throw an error on module collision

hasteMapModulePath string

Path to a custom implementation of HasteMap.

retainAllFiles boolean

Whether to retain all files, allowing e.g. search for tests in node_modules.

injectGlobals boolean

Whether to inject global variables into the global environment. Only supported if using the default jest-circus test runner.

Default: true
maxConcurrency number

A number limiting the number of tests that are allowed to run at the same time when using test.concurrent. Any test above this limit will be queued and executed once a slot is released.

Default: 5
maxWorkers number | string

Specifies the maximum number of workers the worker-pool will spawn for running tests.

moduleDirectories string[]

An array of directory names to be searched recursively up from the requiring module's location.

Default:
[
  "node_modules"
]
moduleFileExtensions string[]

An array of file extensions your modules use.

Default:
[
  "js",
  "mjs",
  "cjs",
  "jsx",
  "ts",
  "tsx",
  "json",
  "node"
]
moduleNameMapper object

A map from regular expressions to module names that allow to stub out resources, like images or styles with a single module.

modulePathIgnorePatterns string[]

An array of regexp pattern strings that are matched against all module paths before those paths are to be considered 'visible' to the module loader.

Default:
[]
modulePaths string[]

An array of directory names that should be used when resolving modules. This is an alternative API to NODE_PATH.

Default:
[]
notify boolean

Whether to use native OS notifications for test results. This requires the installation of the node-notifier package

Default: false
notifyMode string

Specifies when notifications should be triggered.

Default: "failure"
Values: "always" "failure" "success" "change" "success-change" "failure-change"
openHandlesTimeout number

Print a warning indicating that there are probable open handles if Jest does not exit cleanly this number of milliseconds after it completes. Use 0 to disable the warning.

Default: 1000
preset string

A preset that is used as a base for Jest's configuration.

prettierPath string | null

The path to a module that exports an object with a format method.

projects string[]

Jest will run tests in all of these specified projects at the same time.

randomize boolean

Whether to randomize the order of the tests in a file.

Default: false
reporters string | array[]

A list of reporter names (and configuration) that Jest can use.

Default:
[
  "default"
]
resetMocks boolean

Automatically reset mock state before every test.

Default: false
resetModules boolean

By default, each test file gets its own independent module registry. Setting this option to true resets the module registry before running each individual tes

Default: false
resolver string

Use a custom resolver.

restoreMocks boolean

Automatically restore mock state and implementation before every test.

Default: false
rootDir string

The root directory that Jest should scan for tests and modules within.

roots string[]

A list of paths to directories that Jest should use to search for files in.

Default:
[
  "<rootDir>"
]
runner string

The test environment that will be used for testing.

Default: "jest-runner"
Examples: "jest-runner-eslint", "jest-runner-mocha", "jest-runner-tsc", "jest-runner-prettier"
extraGlobals

DEPRECATED. Renamed to sandboxInjectedGlobals in Jest 28

sandboxInjectedGlobals string[]

List of extra properties to be defined in the vm for faster lookups.

setupFiles string[]

A list of paths to modules that run some code to configure or set up the testing environment.

Default:
[]
setupFilesAfterEnv string[]

A list of paths to modules that run some code to configure or set up the testing framework before each test file in the suite is executed.

Default:
[]
showSeed boolean

Whether to print the seed in the test report summary.

Default: false
slowTestThreshold number

The number of seconds after which a test is considered as slow and reported as such in the results.

Default: 5
snapshotFormat object

Allows overriding specific snapshot formatting options documented in the pretty-format readme.

Default:
{
  "escapeString": false,
  "printBasicPrototype": false
}
snapshotResolver string

The path to a module that can resolve test<->snapshot path. This config option lets you customize where Jest stores snapshot files on disk.

snapshotSerializers string[]

A list of paths to snapshot serializer modules Jest should use for snapshot testing.

Default:
[]
testEnvironment string

The test environment that will be used for testing.

Default: "node"
testEnvironmentOptions object

Options that will be passed to the testEnvironment.

Default:
{}
testFailureExitCode number

Exit code of jest command if the test run failed.

Default: 1
testMatch string[]

The glob patterns Jest uses to detect test files.

Default:
[
  "**/__tests__/**/*.[jt]s?(x)",
  "**/?(*.)+(spec|test).[jt]s?(x)"
]
testPathIgnorePatterns string[]

An array of regexp pattern strings that are matched against all test paths before executing the test. If the test path matches any of the patterns, it will be skipped.

Default:
[
  "/node_modules/"
]
testRegex string

The pattern or patterns Jest uses to detect test files.

Default: "(/__tests__/.*|(\.|/)(test|spec))\.[jt]sx?$"
testResultsProcessor string

Use a custom results processor.

testRunner string

Use a custom test runner.

Default: "jest-circus/runner"
testSequencer string

Use a custom test sequencer.

Default: "@jest/test-sequencer"
testTimeout number

Default timeout of a test in milliseconds.

Default: 5000
transform object

A map from regular expressions to paths to transformers.

transformIgnorePatterns string[]

An array of regexp pattern strings that are matched against all source file paths before transformation. If the file path matches any of the patterns, it will not be transformed.

Default:
[
  "/node_modules/",
  "\\.pnp\\.[^\\/]+$"
]
unmockedModulePathPatterns string[]

An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them. If a module's path matches any of the patterns in this list, it will not be automatically mocked by the module loader.

Default:
[]
verbose boolean

Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution.

watchPathIgnorePatterns string[]

An array of RegExp patterns that are matched against all source file paths before re-running tests in watch mode. If the file path matches any of the patterns, when it is updated, it will not trigger a re-run of tests.

Default:
[]
watchPlugins string[]

Enable custom watch plugins

Default:
[]
Examples: ["jest-watch-master"], ["jest-watch-select-projects"], ["jest-watch-suspend"], ["jest-watch-typeahead"], ["jest-watch-yarn-workspaces"]
watchman boolean

Whether to use watchman for file crawling.

Default: true
workerIdleMemoryLimit number | string

Specifies the memory limit for workers before they are recycled.

// string

Comment

workerThreads boolean

Whether to use worker threads for parallelization. Child processes are used by default.

Default: false