Open cdignam-segment opened 2 years ago
Hey 👋🏻
Unfortunately, this sounds a pretty tricky feature to implement in this library. Whereas jest has you specify your snapshots in code, cupaloy does the snapshotting for you and saves them to disk.
The closest library I know of that might help is https://github.com/sebdah/goldie which lets you have Go templates as your snapshots and interpolate values into them at test-time: https://github.com/sebdah/goldie#assertions-using-templates
In contast, cupaloy is very simple and so requires that the datastructure you pass in already has any non-deterministic/non-repeatable data (like timestamps, etc.) mocked out with static values
Jest has a great feature for matching specific types for fields: https://jestjs.io/docs/snapshot-testing#property-matchers
It would be great if this library also support this.