Enable changing only the snapshot filename
See original GitHub issueIs your feature request related to a problem? Please describe. Using tests with dynamic data (e.g. DataRow, DynamicData, DataSource) I want to control the filename of the snapshots, so they do not end up overwriting each other. But I do not want to hardcode any file path, just modify the filename.
Describe the solution you’d like
I would like to use SnapshotId
to specify the snapshot filename, but setting snapshotDirectory
to null so the default location (_snapshots
subdirectory) is used.
Describe alternatives you’ve considered I am currently using child snapshots instead, which is rather tedious because the snapshots themselves are rather large and there are many data rows. There could be a way to specify the folder using path variables or getting the path from the test file, but both are rather tedious and undocumented in Snapper.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hey @DavidInterad, thanks bringing this up.
The current way of controlling snapshots is definitely a bit tedious. Let me have a think about some ideas and I’ll get back to you in about 2 days and then we can go from there.
Yes, that does the trick for me. Thank you very much 😄