gkampitakis / go-snaps

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

Allow configuration of snapshot file names / ending #25

Closed markussiebert closed 2 years ago

markussiebert commented 2 years ago

Hi, at the moment I am struggling with the phenomenon that jest removes the go-snaps test files. Nothing I can change?! So might it be possible to add a parameter to rename the snapshots to maybe .go-snaps?

On the other side, I finally managed to make jest irgnore the go snaps:

"coveragePathIgnorePatterns": [
      "/node_modules/",
      "/lambda/" <- here are the go snaps
],
"testPathIgnorePatterns": [
      "/node_modules/",
      "/lambda/" <- here are the go snaps
],
gkampitakis commented 2 years ago

I would suggest making jest ignore the snap files. It's not that common to run two different runners on the same project or at least I didn't think that was so common :sweat_smile: . In a previous version, I allowed the configuration of filename and ext of the file, but I thought it was not that useful and also made the configuration quite cumbersome as you needed to set a new configuration on every go package of the project.

markussiebert commented 2 years ago

I made it working that jest ignores the snaps files - so everything ok :-)