Open KoNekoD opened 2 days ago
Just
{
...
}
Hi, thanks for opening this issue. This is expected behaviour, of how go-snaps works and not a bug. It's similar to how jest is storing multiple snapshots in a file.
If you want to save your snapshot in a single file as a json you could do
snaps.WithConfig(snaps.Ext(".json")).
MatchStandaloneSnapshot(t, "{}")
This will create a single file with json extension with your data.
@gkampitakis Could you please make a short hook for this?
I want to be able to immediately structure this method to read
Everything in your library would be perfect if you didn't have those fucking square brackets that turn the file red. I tried to refactor it, but the code overcomplicated.
You could do it on your tests instead of creating a short name for every simple configuration option.
jsonSnapshot := snaps.WithConfig(snaps.Ext(".json")).MatchStandaloneSnapshot
....
jsonSnapshot(t, "{}")
and then reuse it wherver you want.
Everything in your library would be perfect if you didn't have those fucking square brackets that turn the file red. I tried to refactor it, but the code overcomplicated.
Sorry for this but this library might not be for you then. You can use https://github.com/bradleyjkemp/cupaloy that does this by default.
Description
Steps to Reproduce
Create json snappshot
Expected Behavior
Without invalid characters, only json file