jest <arg>

A delightful JavaScript Testing Framework with a focus on simplicity

Arguments

NameDescription
arg

Options

NameDescription
--bail, -b <n>Exit the test suite immediately upon n number of failing test suite. Defaults to 1
--cacheWhether to use the cache
--no-cacheWhether to use the cache
--changedFilesWithAncestorRuns tests related to the current changes and the changes made in the last commit
--changedSince <since>Runs tests related to the changes since the provided branch or commit hash
--ciInstead of the regular behavior of storing a new snapshot automatically, will fail the test and require Jest to be run with --updateSnapshot
--clearCache <cacheDirectory>Deletes the Jest cache directory and then exits without running tests
--collectCoverageFrom <glob>A glob pattern relative to rootDir matching the files that coverage info needs to be collected from
--colorsForces test results output highlighting even if stdout is not a TTY
--config, -c <path>The path to a Jest config file specifying how to find and execute tests
--coverage <true|false>Enable or disable coverage, disabled by default
--coverageProvider <babel|v8>Indicates which provider should be used to instrument code for coverage
--debugPrint debugging info about your Jest config
--detectOpenHandlesAttempt to collect and print open handles preventing Jest from exiting cleanly
--env <jsdom|node|path/to/env.js>The test environment used for all tests
--errorOnDeprecatedMake calling deprecated APIs throw helpful error messages
--expand, -eUse this flag to show full diffs and errors instead of a patch
--findRelatedTests <<path1> ... <pathN>>Find and run the tests that cover a space separated list of source files that were passed in as arguments
--forceExitForce Jest to exit after all tests have completed running
--helpShow the help information
--initGenerate a basic configuration file
--injectGlobalsInsert Jest's globals (expect, test, describe, beforeEach etc.) into the global environment
--jsonPrints the test results in JSON
--outputFile <filename>Write test results to a file when the --json option is also specified
--lastCommitRun all tests affected by file changes in the last commit made
--listTestsLists all tests as JSON that Jest will run given the arguments, and exits
--logHeapUsageLogs the heap usage after every test
--maxConcurrency <num>Prevents Jest from executing more than the specified amount of tests at the same time
--maxWorkers, -w <<num>|<string>>Specifies the maximum number of workers the worker-pool will spawn for running tests
--noStackTraceDisables stack trace in test results output
--notifyActivates notifications for test results
--onlyChanged, -oAttempts to identify which tests to run based on which files have changed in the current repository
--passWithNoTestsAllows the test suite to pass when no files are found
--projects <<path1> ... <pathN>...>Run tests from one or more projects, found in the specified paths; also takes path globs
--reporters <reporter>Run tests with specified reporters
--roots <<path1> ... <pathN>...>A list of paths to directories that Jest should use to search for files in
--runInBand, -iRun all tests serially in the current process, rather than creating a worker pool of child processes that run tests
--selectProjects <<project1> ... <projectN>>Run only the tests of the specified projects
--runTestsByPathRun only the tests that were specified with their exact paths
--setupTestFrameworkScriptFile <file>The path to a module that runs some code to configure or set up the testing framework before each test
--showConfigPrint your Jest config and then exits
--silentPrevent tests from printing messages through the console
--testNamePattern, -t <regex>Run only tests with a name that matches the regex
--testLocationInResultsAdds a location field to test results
--testPathPattern <regex>A regexp pattern string that is matched against all tests paths before executing the test
--testPathIgnorePatterns <[array]>An array of regexp pattern strings that are tested against all tests paths before executing the test
--testRunner <path>Lets you specify a custom test runner
--testSequencer <path>Lets you specify a custom test sequencer
--testTimeout <timeout in ms>Default timeout of a test in milliseconds
--updateSnapshot, -uUse this flag to re-record every snapshot that fails during this test run
--useStderrDivert all output to stderr
--verboseDisplay individual test results with the test suite hierarchy
--version, -vPrint the version and exit
--watchWatch files for changes and rerun tests related to changed files
--watchAllWatch files for changes and rerun all tests when something changes
--watchmanWhether to use watchman for file crawling
--no-watchmanWhether to use watchman for file crawling