docs/guide/cli-generated.md
-r, --root <path>Root path
-c, --config <path>Path to config file
-u, --update [type]Update snapshot (accepts boolean, "new", "all" or "none")
-w, --watchEnable watch mode
-t, --testNamePattern <pattern>Run tests with full names matching the specified regexp pattern
--dir <path>Base directory to scan for the test files
--uiEnable UI
--openOpen UI automatically (default: !process.env.CI)
--api.port [port]Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on. If true will be set to 51204
--api.host [host]Specify which IP addresses the server should listen on. Set this to 0.0.0.0 or true to listen on all addresses, including LAN and public addresses
--api.strictPortSet to true to exit if port is already in use, instead of automatically trying the next available port
--api.allowExecAllow API to execute code. (Be careful when enabling this option in untrusted environments)
--api.allowWriteAllow API to edit files. (Be careful when enabling this option in untrusted environments)
--silent [value]Silent console output from tests. Use 'passed-only' to see logs from failing tests only.
--hideSkippedTestsHide logs for skipped tests
--reporter <name>Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)
--outputFile <filename/-s>Write test results to a file when supporter reporter is also specified, use cac's dot notation for individual outputs of multiple reporters (example: --outputFile.tap=./tap.txt)
--coverage.provider <name>Select the tool for coverage collection, available values are: "v8", "istanbul" and "custom"
--coverage.enabledEnables coverage collection. Can be overridden using the --coverage CLI option (default: false)
--coverage.include <pattern>Files included in coverage as glob patterns. May be specified more than once when using multiple patterns. By default only files covered by tests are included.
--coverage.exclude <pattern>Files to be excluded in coverage. May be specified more than once when using multiple extensions.
--coverage.cleanClean coverage results before running tests (default: true)
--coverage.cleanOnRerunClean coverage report on watch rerun (default: true)
--coverage.reportsDirectory <path>Directory to write coverage report to (default: ./coverage)
--coverage.reporter <name>Coverage reporters to use. Visit coverage.reporter for more information (default: ["text", "html", "clover", "json"])
--coverage.reportOnFailureGenerate coverage report even when tests fail (default: false)
--coverage.allowExternalCollect coverage of files outside the project root (default: false)
--coverage.skipFullDo not show files with 100% statement, branch, and function coverage (default: false)
--coverage.thresholds.100Shortcut to set all coverage thresholds to 100 (default: false)
--coverage.thresholds.perFileCheck thresholds per file. See --coverage.thresholds.lines, --coverage.thresholds.functions, --coverage.thresholds.branches and --coverage.thresholds.statements for the actual thresholds (default: false)
--coverage.thresholds.autoUpdate <boolean|function>Update threshold values: "lines", "functions", "branches" and "statements" to configuration file when current coverage is above the configured thresholds (default: false)
--coverage.thresholds.lines <number>Threshold for lines. Visit istanbuljs for more information. This option is not available for custom providers
--coverage.thresholds.functions <number>Threshold for functions. Visit istanbuljs for more information. This option is not available for custom providers
--coverage.thresholds.branches <number>Threshold for branches. Visit istanbuljs for more information. This option is not available for custom providers
--coverage.thresholds.statements <number>Threshold for statements. Visit istanbuljs for more information. This option is not available for custom providers
--coverage.ignoreClassMethods <name>Array of class method names to ignore for coverage. Visit istanbuljs for more information. This option is only available for the istanbul providers (default: [])
--coverage.processingConcurrency <number>Concurrency limit used when processing the coverage results. (default min between 20 and the number of CPUs)
--coverage.customProviderModule <path>Specifies the module name or path for the custom coverage provider module. Visit Custom Coverage Provider for more information. This option is only available for custom providers
--coverage.watermarks.statements <watermarks>High and low watermarks for statements in the format of <high>,<low>
--coverage.watermarks.lines <watermarks>High and low watermarks for lines in the format of <high>,<low>
--coverage.watermarks.branches <watermarks>High and low watermarks for branches in the format of <high>,<low>
--coverage.watermarks.functions <watermarks>High and low watermarks for functions in the format of <high>,<low>
--coverage.changed <commit/branch>Collect coverage only for files changed since a specified commit or branch (e.g., origin/main or HEAD~1). Inherits value from --changed by default.
--coverage.excludeAfterRemapApply exclusions again after coverage has been remapped to original sources. (default: false)
--coverage.htmlDir <path>Directory of HTML coverage output to be served in UI mode and HTML reporter.
--mode <name>Override Vite mode (default: test or benchmark)
--isolateRun every test file in isolation. To disable isolation, use --no-isolate (default: true)
--globalsInject apis globally
--domMock browser API with happy-dom
--browser.enabledRun tests in the browser. Equivalent to --browser.enabled (default: false)
--browser.name <name>Run all tests in a specific browser. Some browsers are only available for specific providers (see --browser.provider).
--browser.headlessRun the browser in headless mode (i.e. without opening the GUI (Graphical User Interface)). If you are running Vitest in CI, it will be enabled by default (default: process.env.CI)
--browser.api.port [port]Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on. If true will be set to 63315
--browser.api.host [host]Specify which IP addresses the server should listen on. Set this to 0.0.0.0 or true to listen on all addresses, including LAN and public addresses
--browser.api.strictPortSet to true to exit if port is already in use, instead of automatically trying the next available port
--browser.api.allowExecAllow API to execute code. (Be careful when enabling this option in untrusted environments)
--browser.api.allowWriteAllow API to edit files. (Be careful when enabling this option in untrusted environments)
--browser.isolateRun every browser test file in isolation. To disable isolation, use --browser.isolate=false (default: true)
--browser.uiShow Vitest UI when running tests (default: !process.env.CI)
--browser.detailsPanelPosition <position>Default position for the details panel in browser mode. Either right (horizontal split) or bottom (vertical split) (default: right)
--browser.fileParallelismShould browser test files run in parallel. Use --browser.fileParallelism=false to disable (default: true)
--browser.connectTimeout <timeout>If connection to the browser takes longer, the test suite will fail (default: 60_000)
--browser.trackUnhandledErrorsControl if Vitest catches uncaught exceptions so they can be reported (default: true)
--browser.trace <mode>Enable trace view mode. Supported: "on", "off", "on-first-retry", "on-all-retries", "retain-on-failure".
--browser.locators.exactShould locators match the text exactly by default (default: false)
--pool <pool>Specify pool, if not running in the browser (default: forks)
--execArgv <option>Pass additional arguments to node process when spawning worker_threads or child_process.
--vmMemoryLimit <limit>Memory limit for VM pools. If you see memory leaks, try to tinker this value.
--fileParallelismShould all test files run in parallel. Use --no-file-parallelism to disable (default: true)
--maxWorkers <workers>Maximum number or percentage of workers to run tests in
--environment <name>Specify runner environment, if not running in the browser (default: node)
--passWithNoTestsPass when no tests are found
--logHeapUsageShow the size of heap for each test when running in node
--detectAsyncLeaksDetect asynchronous resources leaking from the test file (default: false)
--allowOnlyAllow tests and suites that are marked as only (default: !process.env.CI)
--dangerouslyIgnoreUnhandledErrorsIgnore any unhandled errors that occur
--sequence.shuffle.filesRun files in a random order. Long running tests will not start earlier if you enable this option. (default: false)
--sequence.shuffle.testsRun tests in a random order (default: false)
--sequence.concurrentMake tests run in parallel (default: false)
--sequence.seed <seed>Set the randomization seed. This option will have no effect if --sequence.shuffle is falsy. Visit "Random Seed" page for more information
--sequence.hooks <order>Changes the order in which hooks are executed. Accepted values are: "stack", "list" and "parallel". Visit sequence.hooks for more information (default: "parallel")
--sequence.setupFiles <order>Changes the order in which setup files are executed. Accepted values are: "list" and "parallel". If set to "list", will run setup files in the order they are defined. If set to "parallel", will run setup files in parallel (default: "parallel")
--inspect [[host:]port]Enable Node.js inspector (default: 127.0.0.1:9229)
--inspectBrk [[host:]port]Enable Node.js inspector and break before the test starts
--testTimeout <timeout>Default timeout of a test in milliseconds (default: 5000). Use 0 to disable timeout completely.
--hookTimeout <timeout>Default hook timeout in milliseconds (default: 10000). Use 0 to disable timeout completely.
--bail <number>Stop test execution when given number of tests have failed (default: 0)
--retry.count <times>Number of times to retry a test if it fails (default: 0)
--retry.delay <ms>Delay in milliseconds between retry attempts (default: 0)
--retry.condition <pattern>Regex pattern to match error messages that should trigger a retry. Only errors matching this pattern will cause a retry (default: retry on all errors)
--diff.aAnnotation <annotation>Annotation for expected lines (default: Expected)
--diff.aIndicator <indicator>Indicator for expected lines (default: -)
--diff.bAnnotation <annotation>Annotation for received lines (default: Received)
--diff.bIndicator <indicator>Indicator for received lines (default: +)
--diff.commonIndicator <indicator>Indicator for common lines (default: )
--diff.contextLines <lines>Number of lines of context to show around each change (default: 5)
--diff.emptyFirstOrLastLinePlaceholder <placeholder>Placeholder for an empty first or last line (default: "")
--diff.expandExpand all common lines (default: true)
--diff.includeChangeCountsInclude comparison counts in diff output (default: false)
--diff.omitAnnotationLinesOmit annotation lines from the output (default: false)
--diff.printBasicPrototypePrint basic prototype Object and Array (default: true)
--diff.maxDepth <maxDepth>Limit the depth to recurse when printing nested objects (default: 20)
--diff.truncateThreshold <threshold>Number of lines to show before and after each change (default: 0)
--diff.truncateAnnotation <annotation>Annotation for truncated lines (default: ... Diff result is truncated)
--exclude <glob>Additional file globs to be excluded from test
--expandSnapshotDiffShow full diff when snapshot fails
--disableConsoleInterceptDisable automatic interception of console logging (default: false)
--typecheck.enabledEnable typechecking alongside tests (default: false)
--typecheck.onlyRun only typecheck tests. This automatically enables typecheck (default: false)
--typecheck.checker <name>Specify the typechecker to use. Available values are: "tsc" and "vue-tsc" and a path to an executable (default: "tsc")
--typecheck.allowJsAllow JavaScript files to be typechecked. By default takes the value from tsconfig.json
--typecheck.ignoreSourceErrorsIgnore type errors from source files
--typecheck.tsconfig <path>Path to a custom tsconfig file
--typecheck.spawnTimeout <time>Minimum time in milliseconds it takes to spawn the typechecker
--project <name>The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2. You can also filter projects using wildcards like --project=packages*, and exclude projects with --project=!pattern.
--slowTestThreshold <threshold>Threshold in milliseconds for a test or suite to be considered slow (default: 300)
--teardownTimeout <timeout>Default timeout of a teardown function in milliseconds (default: 10000)
--maxConcurrency <number>Maximum number of concurrent tests and suites during test file execution (default: 5)
--expect.requireAssertionsRequire that all tests have at least one assertion
--expect.poll.interval <interval>Poll interval in milliseconds for expect.poll() assertions (default: 50)
--expect.poll.timeout <timeout>Poll timeout in milliseconds for expect.poll() assertions (default: 1000)
--printConsoleTraceAlways print console stack traces
--includeTaskLocationCollect test and suite locations in the location property
--attachmentsDir <dir>The directory where attachments from context.annotate are stored in (default: .vitest-attachments)
--runDisable watch mode
--no-colorRemoves colors from the console output
--clearScreenClear terminal screen when re-running tests during watch mode (default: true)
--configLoader <loader>Use bundle to bundle the config with esbuild or runner (experimental) to process it on the fly. This is only available in vite version 6.1.0 and above. (default: bundle)
--standaloneStart Vitest without running tests. Tests will be running only on change. If browser mode is enabled, the UI will be opened automatically. This option is ignored when CLI file filters are passed. (default: false)
--listTags [type]List all available tags instead of running tests. --list-tags=json will output tags in JSON format, unless there are no tags.
--clearCacheDelete all Vitest caches, including experimental.fsModuleCache, without running any tests. This will reduce the performance in the subsequent test run.
--tagsFilter <expression>Run only tests with the specified tags. You can use logical operators && (and), || (or) and ! (not) to create complex expressions, see Test Tags for more information.
--strictTagsShould Vitest throw an error if test has a tag that is not defined in the config. (default: true)
--experimental.fsModuleCacheEnable caching of modules on the file system between reruns.
--experimental.importDurations.print <boolean|on-warn>When to print import breakdown to CLI terminal. Use true to always print, false to never print, or on-warn to print only when imports exceed the warn threshold (default: false).
--experimental.importDurations.limit <number>Maximum number of imports to collect and display (default: 0, or 10 if print or UI is enabled).
--experimental.importDurations.failOnDangerFail the test run if any import exceeds the danger threshold (default: false).
--experimental.importDurations.thresholds.warn <number>Warning threshold - imports exceeding this are shown in yellow/orange (default: 100).
--experimental.importDurations.thresholds.danger <number>Danger threshold - imports exceeding this are shown in red (default: 500).
--experimental.viteModuleRunnerControl whether Vitest uses Vite's module runner to run the code or fallback to the native import. (default: true)
--experimental.nodeLoaderControls whether Vitest will use Node.js Loader API to process in-source or mocked files. This has no effect if viteModuleRunner is enabled. Disabling this can increase performance. (default: true)
--experimental.vcsProvider <path>Custom provider for detecting changed files. (default: git)
--experimental.preParseParse test specifications before running them. This will apply .only flag and test name pattern across all files without running them. (default: false)