You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, it would seem so. VCR had a similar discussion, and there's a formatter available there that hits some false positives in my experience. I'm not sure how the same would look for rspec-snapshot, so in the meantime, I did the following inside each snapshot directory (I only have one right now):
rg -IN --only-matching 'match_snapshot\("(.*)"\)' -r '$1.snap' | sort -u > ../safe_snapshots.txt
for i in *; do
if ! grep -qxFe "$i" ../safe_snapshots.txt; then
echo "Deleting: $i"
# the next line is commented out. Test it. Then uncomment to remove the files
# rm "$i"
fi
done
This won't work if you alias match_snapshot or use it as part of a matcher.
Looks like the UPDATE_SNAPSHOT flag doesn't remove obsolete snapshots. Should I do it manually then?
The text was updated successfully, but these errors were encountered: