Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions snaps/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ func examineSnaps(
return nil, isDirty, err
}

var needsUpdating bool

registeredTests := occurrences(registry[snapPath], count, snapshotOccurrenceFMT)
s := snapshotScanner(f)

Expand All @@ -267,7 +265,6 @@ func examineSnaps(

if !registeredTests.Has(testID) && !testSkipped(testID, runOnly) {
obsoleteTests = append(obsoleteTests, testID)
needsUpdating = true

removeSnapshot(s)
continue
Expand Down Expand Up @@ -297,7 +294,7 @@ func examineSnaps(
// if we're not allowed to update anything, just capture if the snapshot
// needs cleaning, and then continue to the next snapshot
if !shouldUpdate {
if needsUpdating || needsSorting {
if len(obsoleteTests) > 0 || needsSorting {
isDirty = true
}

Expand Down
Loading