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

Could customSnapshotDir be a callback? #347

Open
velvet-dream opened this issue Feb 1, 2024 · 0 comments
Open

Could customSnapshotDir be a callback? #347

velvet-dream opened this issue Feb 1, 2024 · 0 comments

Comments

@velvet-dream
Copy link

velvet-dream commented Feb 1, 2024

As suggested here in this issue #62

It would be really useful to have customSnapshotsDir specified as function, in order to have much more flexibility over the way snapshots are stored, and make it possible to generate path on the fly depending on testPath, etc.

{ customSnapshotsDir: ({currentTestName, testPath}) => buildCustomSnapshotDirOnTheFly(currentTestName, testPath) }

In my usecase, we have our own framework with our React components. There are many components, and I would like to get all the snapshots stored in the same directory, with a structure identical to that of the framework. Something that would look like this:

root/
├─ snapshots/
│  ├─ inputs/
│  │  ├─ button/
│  │  │  ├─ button-snapshot.png
│  │  ├─ inputNumber/
│  │  │  ├─ inputNumber-snapshot.png

A commit was submitted a few years ago : goverdhan07@0277834

What do you think?

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

1 participant