jest <arg>

A delightful JavaScript Testing Framework with a focus on simplicity

Arguments

NameDescription
arg

Options

NameDescription
--bail,-b <command>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 <command>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 <command>Deletes the Jest cache directory and then exits without running tests
--collectCoverageFrom <command>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 <command>The path to a Jest config file specifying how to find and execute tests
--coverage <command>Enable or disable coverage, disabled by default
--coverageProvider <command>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 <command>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 <command>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 <command>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 <command>Prevents Jest from executing more than the specified amount of tests at the same time
--maxWorkers,-w <command>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 <command...>Run tests from one or more projects, found in the specified paths; also takes path globs
--reporters <command>Run tests with specified reporters
--roots <command...>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 <command>Run only the tests of the specified projects
--runTestsByPathRun only the tests that were specified with their exact paths
--setupTestFrameworkScriptFile <command>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 <command>Run only tests with a name that matches the regex
--testLocationInResultsAdds a location field to test results
--testPathPattern <command>A regexp pattern string that is matched against all tests paths before executing the test
--testPathIgnorePatterns <command>An array of regexp pattern strings that are tested against all tests paths before executing the test
--testRunner <command>Lets you specify a custom test runner
--testSequencer <command>Lets you specify a custom test sequencer
--testTimeout <command>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