Documentation ¶
Rendered for js/wasm
Overview ¶
Package assert contains small assertion test functions to assist in writing clean tests.
Index ¶
- func Contains(tb testing.TB, collection, item interface{}) bool
- func Equal(tb testing.TB, expected, actual interface{}) bool
- func Error(tb testing.TB, err error) bool
- func ErrorIs(tb testing.TB, err, target error) bool
- func Eventually(tb testing.TB, fn func(context.Context) bool, totalWait time.Duration, ...) bool
- func NoError(tb testing.TB, err error) bool
- func NotContains(tb testing.TB, collection, item interface{}) bool
- func NotEqual(tb testing.TB, expected, actual interface{}) bool
- func NotErrorIs(tb testing.TB, err, target error) bool
- func NotPanics(tb testing.TB, fn func()) bool
- func NotZero(tb testing.TB, value interface{}) bool
- func Panics(tb testing.TB, fn func()) (panicked bool)
- func Zero(tb testing.TB, value interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eventually ¶
func Eventually(tb testing.TB, fn func(context.Context) bool, totalWait time.Duration, checkInterval time.Duration) bool
Eventually asserts fn() returns true within totalWait time, checking at the given interval
func NotContains ¶
NotContains asserts item is not contained by collection
func NotErrorIs ¶ added in v0.3.2
NotErrorIs asserts err does match target
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.