Skip to content

Commit

Permalink
fix: don't mark skipped snapshots as obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jun 19, 2022
1 parent df0e69c commit 21ae145
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/vitest/src/integrations/snapshot/client.ts
Expand Up @@ -57,6 +57,10 @@ export class SnapshotClient {
this.test = undefined
}

skipTestSnapshots(test: Test) {
this.snapshotState?.markSnapshotsAsCheckedForTest(test.name)
}

assert(options: AssertOptions): void {
const {
test = this.test,
Expand Down
4 changes: 3 additions & 1 deletion packages/vitest/src/runtime/run.ts
Expand Up @@ -78,8 +78,10 @@ async function sendTasksUpdate() {
}

export async function runTest(test: Test) {
if (test.mode !== 'run')
if (test.mode !== 'run') {
getSnapshotClient().skipTestSnapshots(test)
return
}

if (test.result?.state === 'fail') {
updateTask(test)
Expand Down

0 comments on commit 21ae145

Please sign in to comment.