Documentation
¶
Overview ¶
Package stdcrpcsnap provides snapshot testing for Connect RPC response.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessageSnapshotEq ¶
MessageSnapshotEq compares the protobuf message against a snapshot. If the snapshot file doesn't exist it is created instead.
Types ¶
type Overwrite ¶
Overwrite allows a test case to overwrite part of the actual message before it is compared with the snapshot. This is useful for asserting data that changes by definition. It is a last-resort option and making sure the data is stable to begin with is preferred.
func PinResponseValue ¶
func PinResponseValue(atPath string, toValue any, assertActual ...func(v gjson.Result) bool) Overwrite
PinResponseValue is a helper that allows for dealing with response values that are not static so cannot be predicted for the snapshot value. The optional 'assertActual' can still assert the actual value even though it wouldn't match the snapshot.