Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow modifying screenshot filename #71

Open
mihkeleidast opened this issue Jul 23, 2021 · 1 comment
Open

Allow modifying screenshot filename #71

mihkeleidast opened this issue Jul 23, 2021 · 1 comment

Comments

@mihkeleidast
Copy link

Hello! I'm trying to evaluate if I can migrate from jest-image-snapshot to this library since this seems to run a lot faster.

Since I've got a lot of existing snapshots that I would rather not rename/update (so I wouldn't have to validate everything manually), I would like to change the name of the snapshots so I could use the same naming scheme as jest-image-snapshot uses. Additionally, we need to have the ability to change the filename based on some env variables, so a function would be good.

jest-image-snapshot allows doing this with the customSnapshotIdentifier option that can be a function. Would you consider adding something similar?

I tried doing this in my project by overriding the toMatchImageSnapshot with a custom matcher, but got stuck with the test count in the filename.

@fjaeger
Copy link

fjaeger commented Feb 16, 2022

Allowing to provide a custom snapshot identifier would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants