cypress-image-snapshot icon indicating copy to clipboard operation
cypress-image-snapshot copied to clipboard

snapFilenameExtension cause removing of snapshot after test

Open dorley opened this issue 1 year ago • 2 comments

When defining snapFilenameExtension (e.g. to empty string), the snapshot image will be removed after execute method call to 'matchImageSnapshot', if removed 'snapFilenameExtension' then it will work just fine.

Sample code:

addMatchImageSnapshotCommand({ failureThreshold: 0.2, capture: 'viewport',
// snapFilenameExtension: '', })

dorley avatar Jun 24 '24 07:06 dorley

I use it in the same way, and problem occurs too for me

kamiloski88 avatar Jul 09 '24 11:07 kamiloski88

There is a specific test case to allow snapFilenameExtension to be an empty string, so this should be fine. For that reason I need a more robust reproduction of the issue to make that test fail

https://github.com/simonsmith/cypress-image-snapshot/blob/master/cypress/e2e/matchImageSnapshot.cy.ts#L28-L42

Can you also check #48 and see if that is related?

simonsmith avatar Sep 16 '24 19:09 simonsmith