From c62f9c8698d582ef27625e5fdbd82b7b09f13227 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 26 Oct 2025 19:34:03 +0100 Subject: [PATCH] fix!: move `update` flag to CLI options --- docs/config/index.md | 8 -------- packages/vitest/src/node/types/config.ts | 14 +++++++------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index f6def6a5cf09..a4b77cb09092 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -593,14 +593,6 @@ jsdom environment exposes `jsdom` global variable equal to the current [JSDOM](h These options are passed down to `setup` method of current [`environment`](#environment). By default, you can configure only JSDOM options, if you are using it as your test environment. -### update - -- **Type:** `boolean` -- **Default:** `false` -- **CLI:** `-u`, `--update`, `--update=false` - -Update snapshot files. This will update all changed snapshots and delete obsolete ones. - ### watch - **Type:** `boolean` diff --git a/packages/vitest/src/node/types/config.ts b/packages/vitest/src/node/types/config.ts index c355a03cf16b..03ae2a0d5d96 100644 --- a/packages/vitest/src/node/types/config.ts +++ b/packages/vitest/src/node/types/config.ts @@ -359,13 +359,6 @@ export interface InlineConfig { */ projects?: TestProjectConfiguration[] - /** - * Update snapshot - * - * @default false - */ - update?: boolean - /** * Watch mode * @@ -897,6 +890,13 @@ export interface UserConfig extends InlineConfig { */ dom?: boolean + /** + * Update snapshot + * + * @default false + */ + update?: boolean + /** * Run tests that cover a list of source files */