I've added in cypress.config.ts
retries: {
runMode: 2,
},
And now when tests are running, if the first attempt failed, then will be generated a new snapshot with a name like:
web-client-app/cypress/snapshots/upload-financial-statements-page/provider/provider_statements_page.cy.ts/page-loaded-laptop-1280x720 (attempt 2).snap.png
This file tries to find a diff with a file with the same name, but a file with this name not exists, that's why no error will be thrown and a new snapshot with "attempt 2" in the name will be added.
There is a PR in the original repo jaredpalmer/cypress-image-snapshot#155 that I believe fixes this issue, can you check it please?)