Skip to content

Commit bfacae6

Browse files
authored
Merge pull request #55 from SjorsO/patch-1
Fix updating failed file-snapshots
2 parents 5430ae5 + 84f8faa commit bfacae6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MatchesSnapshots.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,17 @@ protected function doFileSnapshotAssertion(string $filePath)
209209
$fileSystem->copy($filePath, $snapshotId);
210210

211211
$this->registerSnapshotChange("File snapshot created for {$snapshotId}");
212+
213+
return;
212214
}
213215

214216
if (! $fileSystem->fileEquals($filePath, $snapshotId)) {
215217
if ($this->shouldUpdateSnapshots()) {
216218
$fileSystem->copy($filePath, $snapshotId);
217219

218220
$this->registerSnapshotChange("File snapshot updated for {$snapshotId}");
221+
222+
return;
219223
}
220224

221225
$fileSystem->copy($filePath, $failedSnapshotId);

0 commit comments

Comments
 (0)