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

go-snaps `permission denied` when running from packagestest #43

Closed gkampitakis closed 2 years ago

gkampitakis commented 2 years ago

When trying to run snaps.Matchsnapshot with packagestest returns error mkdir /redacted/..../go/packages/packagestest/__snapshots__: permission denied.

reporter: @rtfpessoa

gkampitakis commented 2 years ago

This is also happening when calling from "github.com/stretchr/testify/suite".

func (suite *ExampleTestSuite) TestExampleSnapshot() {
    snaps.MatchSnapshot(suite.T(), "hello world")
}

// In order for 'go test' to run this suite, we need to create
// a normal test function and pass our suite to suite.Run
func TestExampleTestSuite(t *testing.T) {
    suite.Run(t, new(ExampleTestSuite))
}