From 3d8e846b12673800ad80d75ba2423081f76eda01 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 5 May 2022 18:33:56 +0300 Subject: [PATCH] fix: default to faled tests and unchecked snapshots when updating snapshots (#1238) --- packages/vitest/src/node/core.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index d01b47c2db6a..2730a0fbe53b 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -263,7 +263,10 @@ export class Vitest { async updateSnapshot(files?: string[]) { // default to failed files - files = files || this.state.getFailedFilepaths() + files = files || [ + ...this.state.getFailedFilepaths(), + ...this.snapshot.summary.uncheckedKeysByFile.map(s => s.filePath), + ] this.configOverride = { snapshotOptions: {