gkampitakis / go-snaps

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

[Feature Request]: MatchYAML #74

Open pmarchini opened 11 months ago

pmarchini commented 11 months ago

🚀 Feature Proposal

Considering the existence of the MatchJSON function, I suggest to introduce a similar implementation for YAML files: MatchYAML.

If agreeable, I would like to collaborate implementing this feature.

Motivation

I'm using this library for a project where I need to handle some data via JSON and YAML and I'd like to have the same functionality that I've with MatchJSON

Example

No response

gkampitakis commented 11 months ago

Hey 👋 Thanks for opening this issue and using go-snaps. I have thought about it but wasn't sure if it's a functionality people would use.

If agreeable, I would like to collaborate implementing this feature.

Not sure if you had any look on the MatchJSON and how is implemented. Under the hood it's using gjson and sjson for accessing values and assinging values into keys. Unfortunately yaml doesn't have some similar support so we should built something similarto support this functionality ( e.g. get a specific key and set a specific key ).

That said happy to discuss about it.