Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshotter ¶
type Snapshotter struct { SnapshotErrors bool // contains filtered or unexported fields }
Snapshotter is a utility for writing snapshot tests. In a snapshot, the expected test output is generated by running the test and storing the output, which for complex test outputs would otherwise require a lot of effort to write.
func New ¶
func New(t T) *Snapshotter
New creates a new Snapshotter. Any errors encountered will fail the test.
func NewNamed ¶
func NewNamed(t T, name string) *Snapshotter
func (*Snapshotter) Snapshot ¶
func (s *Snapshotter) Snapshot(name string, values ...interface{})
Snapshot records a value for a snapshot test. For the test to pass, all invocations to Snapshot should have the same arguments. All values should be JSON-marshalable.
func (*Snapshotter) Verify ¶
func (s *Snapshotter) Verify()
Verify finishes a snapshot test. It either compares the test output, or it rewrites the test output.
Click to show internal directories.
Click to hide internal directories.