Documentation ¶
Index ¶
- func CmpIgnoreTimes() cmp.Option
- func Contains(t testing.TB, body, substr string, opts ...Option) bool
- func DoesNotContain(t testing.TB, body, substr string, opts ...Option) bool
- func Equal(t testing.TB, got, want interface{}, opts ...Option) bool
- func ErrorIs(t testing.TB, got, expected error, opts ...Option)
- func Fail(t testing.TB, fmt string, args ...interface{})
- func FailContinue(t testing.TB, fmt string, args ...interface{})
- func False(t testing.TB, got bool, opts ...Option) bool
- func HTTPError(t *testing.T, err error, code int)
- func IsNil(t testing.TB, got interface{}, opts ...Option) bool
- func NoErr(t testing.TB, err error, opts ...Option)
- func NotEqual(t testing.TB, got, want interface{}, opts ...Option) bool
- func NotNil(t testing.TB, got interface{}, opts ...Option) bool
- func True(t testing.TB, got bool, opts ...Option) bool
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmpIgnoreTimes ¶ added in v0.7.6
CmpIgnoreTimes is a cmp.Option that ignores BaseModel.Created, BaseModel.Updated, and BaseModel.Version This is useful if you want to display a diff without times (eg. `assert.Errorf("diff: %s", cmp.Diff(got, want, IgnoreTimes()))“)
func DoesNotContain ¶ added in v1.4.0
DoesNotContain asserts that one string does not contain another
func FailContinue ¶ added in v0.8.0
FailContinue marks the test as failed, but continues execution
func HTTPError ¶ added in v1.1.0
HTTPError asserts that an error is an HTTP error with the given status code
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option defines a way to modify assert behavior
func CmpOpt ¶
CmpOpt adds a cmp.Option from the underlying lib Useful for things like .IgnoreUnexported
func IgnoreTimes ¶ added in v0.7.6
func IgnoreTimes() Option
IgnoreTimes ignores BaseModel.Created, BaseModel.Updated, and BaseModel.Version for cmp operations This is a helper to pass directly into eg. `assert.Equal`