gkampitakis / go-snaps

Jest-like snapshot testing in Go 📸
https://pkg.go.dev/github.com/gkampitakis/go-snaps
MIT License
165 stars 6 forks source link

feat: implement MatchJSON snapshot function #49

Closed gkampitakis closed 1 year ago

gkampitakis commented 2 years ago

Provide MatchJSON function. As the name indicates it will accept either string or []byte, check if it's a valid JSON and save it in a pretty format for more readability.

~It will also provide support for some utility matchers on fields ( similar to what jest does expect.any but with more variety ). It should also give you the ability to provide your own custom matchers.~

~Right now there is only some testing with Ignore.~

This pr got too big, will break it to more prs as functionalities can be splitted.