Skip to content
/ go-fixture Public

Go assertions against test fixtures with nice line diffs, and an -update flag for updating fixture or "golden" files.

License

Notifications You must be signed in to change notification settings

tj/go-fixture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fixture

Package fixture provides test assertions using test fixtures with nice line diffs, and an -update flag for bootstrapping & updating fixtures.

Example

func TestGenerate(t *testing.T) {
  // ... pretend we generate some client code here for TypeScript
  var act bytes.Buffer
  err = tsclient.Generate(&act)
  assert.NoError(t, err, "generating")

  // assert the contents of act.Bytes() to the test fixture ./testdata/client.ts
  fixture.Assert(t, "client.ts", act.Bytes())
}

GoDoc

Sponsors

This project is sponsored by CTO.ai, making it easy for development teams to create and share workflow automations without leaving the command line.

And my GitHub sponsors:

About

Go assertions against test fixtures with nice line diffs, and an -update flag for updating fixture or "golden" files.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages