Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
JSONTools / Schema registry / Jest
Schema registry

Jest

A JavaScript Testing Framework

jest.config.json

Check your file against this schema

Opens the validator with this schema already loaded. Paste your jest.config.json and it validates in your browser — nothing is uploaded.

Validate a jest.config.json → View raw schema

Fields

Generated directly from the schema, following local $refs, to two levels of nesting.

Field Type Description
automockbooleanWhether 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
bailboolean | numberHow many failures until jest stops running. Value of `true` is equivalent to 1.
default: 0
cacheDirectorystringThe directory where Jest should store its cached dependency information.
clearMocksbooleanWhether to automatically clear mock calls and instances between every test.
default: false
collectCoveragebooleanWhether to collect coverage information while executing the test
default: false
collectCoverageFromarray<string>An array of glob patterns indicating a set of files for which coverage information should be collected.
coverageDirectorystringThe directory where Jest should output its coverage files.
coveragePathIgnorePatternsarray<string>An array of regexp pattern strings that will be ignored when calculating coverage
default: ["/node_modules/"]
coverageProviderstringIndicates which provider should be used to instrument code for coverage.
default: "babel"
one of: "babel", "v8"
coverageReportersarrayA list of reporter names that Jest uses when writing coverage reports.
default: ["clover", "json", "lcov", "text"]
coverageThresholdobjectAn object that configures minimum threshold enforcement for coverage results.
dependencyExtractorstringEnable the use of a custom dependency extractor.
displayNameoneOfA custom label that is printed alongside a test while it is running.
errorOnDeprecatedbooleanWhether calling deprecated APIs should throw an error.
default: false
extensionsToTreatAsEsmarray<string>Files extensions that Jest should treat as ESM.
default: []
fakeTimersobjectCustomize the behavior of fake timers.
default: {}
forceCoverageMatcharray<string>A list of regexp strings are added to code coverage; this overrides any previous ignored file patterns
default: [""]
globalsobjectA set of global variables that need to be available in all test environments.
default: {}
globalSetupstringUse a custom global setup module to setup the global environment.
globalTeardownstringUse a custom global teardown module to teardown the global environment.
hasteobjectCustomize `jest-haste-map`, Jest's internal file crawler/cache system
haste.computeSha1booleanWhether to hash functions using SHA1
haste.defaultPlatformstring | nullThe default platform
haste.forceNodeFilesystemAPIbooleanWhether to use Node's filesystem API instead of shelling out to `find`
haste.enableSymlinksbooleanWhether to follow symlinks when crawling the filesystem. This option cannot be used in projects that use watachman.
haste.hasteImplModulePathstringPath to a custom implementation of Haste.
haste.platformsarray<string>A list of platforms to target.
haste.throwOnModuleCollisionbooleanWhether to throw an error on module collision
haste.hasteMapModulePathstringPath to a custom implementation of HasteMap.
haste.retainAllFilesbooleanWhether to retain all files, allowing e.g. search for tests in `node_modules`.
injectGlobalsbooleanWhether to inject global variables into the global environment. Only supported if using the default `jest-circus` test runner.
default: true
maxConcurrencynumberA 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
maxWorkersnumber | stringSpecifies the maximum number of workers the worker-pool will spawn for running tests.
moduleDirectoriesarray<string>An array of directory names to be searched recursively up from the requiring module's location.
default: ["node_modules"]
moduleFileExtensionsarray<string>An array of file extensions your modules use.
default: ["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"]
moduleNameMapperobjectA map from regular expressions to module names that allow to stub out resources, like images or styles with a single module.
modulePathIgnorePatternsarray<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: []
modulePathsarray<string>An array of directory names that should be used when resolving modules. This is an alternative API to `NODE_PATH`.
default: []
notifybooleanWhether to use native OS notifications for test results. This requires the installation of the `node-notifier` package
default: false
notifyModestringSpecifies when notifications should be triggered.
default: "failure"
one of: "always", "failure", "success", "change", "success-change", "failure-change"
openHandlesTimeoutnumberPrint 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
presetstringA preset that is used as a base for Jest's configuration.
prettierPathstring | nullThe path to a module that exports an object with a `format` method.
projectsarray<string>Jest will run tests in all of these specified projects at the same time.
randomizebooleanWhether to randomize the order of the tests in a file.
default: false
reportersarrayA list of reporter names (and configuration) that Jest can use.
default: ["default"]
resetMocksbooleanAutomatically reset mock state before every test.
default: false
resetModulesbooleanBy 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
resolverstringUse a custom resolver.
restoreMocksbooleanAutomatically restore mock state and implementation before every test.
default: false
rootDirstringThe root directory that Jest should scan for tests and modules within.
rootsarray<string>A list of paths to directories that Jest should use to search for files in.
default: ["<rootDir>"]
runnerstringThe test environment that will be used for testing.
default: "jest-runner"
extraGlobalsdeprecatedanyDEPRECATED. Renamed to `sandboxInjectedGlobals` in Jest 28
sandboxInjectedGlobalsarray<string>List of extra properties to be defined in the vm for faster lookups.
setupFilesarray<string>A list of paths to modules that run some code to configure or set up the testing environment.
default: []
setupFilesAfterEnvarray<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: []
showSeedbooleanWhether to print the seed in the test report summary.
default: false
slowTestThresholdnumberThe number of seconds after which a test is considered as slow and reported as such in the results.
default: 5
snapshotFormatobjectAllows overriding specific snapshot formatting options documented in the `pretty-format readme`.
default: {"escapeString": false, "printBasicPrototype": false}
snapshotResolverstringThe path to a module that can resolve test<->snapshot path. This config option lets you customize where Jest stores snapshot files on disk.
snapshotSerializersarray<string>A list of paths to snapshot serializer modules Jest should use for snapshot testing.
default: []
testEnvironmentstringThe test environment that will be used for testing.
default: "node"
testEnvironmentOptionsobjectOptions that will be passed to the `testEnvironment`.
default: {}
testFailureExitCodenumberExit code of `jest` command if the test run failed.
default: 1
testMatcharray<string>The glob patterns Jest uses to detect test files.
default: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?…
testPathIgnorePatternsarray<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/"]
testRegexstringThe pattern or patterns Jest uses to detect test files.
default: "(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$"
testResultsProcessorstringUse a custom results processor.
testRunnerstringUse a custom test runner.
default: "jest-circus/runner"
testSequencerstringUse a custom test sequencer.
default: "@jest/test-sequencer"
testTimeoutnumberDefault timeout of a test in milliseconds.
default: 5000
transformobjectA map from regular expressions to paths to transformers.
transformIgnorePatternsarray<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\\.[^\\/]+$"]
unmockedModulePathPatternsarray<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
default: []
verbosebooleanIndicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution.
watchPathIgnorePatternsarray<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: []
watchPluginsarray<string>Enable custom watch plugins
default: []
watchmanbooleanWhether to use `watchman` for file crawling.
default: true
workerIdleMemoryLimitnumber | stringSpecifies the memory limit for workers before they are recycled.
//stringComment
workerThreadsbooleanWhether to use worker threads for parallelization. Child processes are used by default.
default: false

What we found in this schema

Specification sections for the keywords in this schema

Keyword Document Section
$idJSON Schema Core, draft 2020-12§8.2.1 — The "$id" Keyword
$schemaJSON Schema Core, draft 2020-12§8.1.1 — "$schema"
additionalPropertiesJSON Schema Core, draft 2020-12§10.3.2.3 — "additionalProperties"
anyOfJSON Schema Core, draft 2020-12§10.2.1.2 — "anyOf"
defaultJSON Schema Validation, draft 2020-12§9.2 — "default"
descriptionJSON Schema Validation, draft 2020-12§9.1 — "title" and "description"
enumJSON Schema Validation, draft 2020-12§6.1.2 — "enum"
examplesJSON Schema Validation, draft 2020-12§9.5 — "examples"
itemsJSON Schema Core, draft 2020-12§10.3.1.2 — "items"
propertiesJSON Schema Core, draft 2020-12§10.3.2.1 — "properties"
typeJSON Schema Validation, draft 2020-12§6.1.1 — "type"

Documents

Attribution

This schema comes from SchemaStore, distributed under the Apache License 2.0. Copyright 2015–present Mads Kristensen and contributors. View the original file. The field table and audit on this page are generated by JSONTools.tools; the schema itself is unmodified.

← All schemas