From 837711d7173b1801def94423555342eb5a331b30 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 10 Feb 2022 10:47:40 +0800 Subject: [PATCH] fix: run mode resolving, close #717, close #719 --- packages/vitest/src/constants.ts | 1 - packages/vitest/src/node/cli.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/constants.ts b/packages/vitest/src/constants.ts index 913a436ac0b4..8c834e5e53dd 100644 --- a/packages/vitest/src/constants.ts +++ b/packages/vitest/src/constants.ts @@ -49,7 +49,6 @@ export const configDefaults: UserConfig = Object.freeze({ isolate: true, watchIgnore: [/\/node_modules\//, /\/dist\//], update: false, - watch: !process.env.CI, reporters: ['default'], silent: false, api: false, diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index f8522e0c41af..2e71018c8cb8 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -62,6 +62,8 @@ async function runRelated(relatedFiles: string[] | string, argv: UserConfig) { } async function dev(cliFilters: string[], argv: UserConfig) { + if (argv.watch == null) + argv.watch = !process.env.CI && !argv.run await run(cliFilters, argv) }