[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix: default to run mode when stdin is not a TTY (#7673)

Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com>
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>

authored by

Kenton Varda
Hiroshi Ogawa
Vladimir
and committed by
GitHub
(Apr 17, 2025, 12:17 PM +0200) 6358f216 5ba0d914

+8 -4
+5 -1
docs/config/index.md
··· 686 686 ### watch<NonProjectOption /> 687 687 688 688 - **Type:** `boolean` 689 - - **Default:** `!process.env.CI` 689 + - **Default:** `!process.env.CI && process.stdin.isTTY` 690 690 - **CLI:** `-w`, `--watch`, `--watch=false` 691 691 692 692 Enable watch mode 693 + 694 + In interactive environments, this is the default, unless `--run` is specified explicitly. 695 + 696 + In CI, or when run from a non-interactive shell, "watch" mode is not the default, but can be enabled explicitly with this flag. 693 697 694 698 ### root 695 699
+2 -2
docs/guide/cli.md
··· 9 9 10 10 ### `vitest` 11 11 12 - Start Vitest in the current directory. Will enter the watch mode in development environment and run mode in CI automatically. 12 + Start Vitest in the current directory. Will enter the watch mode in development environment and run mode in CI (or non-interactive terminal) automatically. 13 13 14 14 You can pass an additional argument as the filter of the test files to run. For example: 15 15 ··· 50 50 51 51 ### `vitest watch` 52 52 53 - Run all test suites but watch for changes and rerun tests when they change. Same as calling `vitest` without an argument. Will fallback to `vitest run` in CI. 53 + Run all test suites but watch for changes and rerun tests when they change. Same as calling `vitest` without an argument. Will fallback to `vitest run` in CI or when stdin is not a TTY (non-interactive environment). 54 54 55 55 ### `vitest dev` 56 56
+1 -1
packages/vitest/src/defaults.ts
··· 131 131 }> = Object.freeze({ 132 132 allowOnly: !isCI, 133 133 isolate: true, 134 - watch: !isCI, 134 + watch: !isCI && process.stdin.isTTY, 135 135 globals: false, 136 136 environment: 'node' as const, 137 137 pool: 'forks' as const,