package assert
import "github.com/hack-pad/go-indexeddb/idb/internal/assert"
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 Eventually(tb testing.TB, fn func(context.Context) bool, totalWait time.Duration, checkInterval 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 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
Functions ¶
func Contains ¶
Contains asserts item is contained by collection
func Equal ¶
Equal asserts actual is equal to expected
func Error ¶
Error asserts err is not nil
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 NoError ¶
NoError asserts err is nil
func NotContains ¶
NotContains asserts item is not contained by collection
func NotEqual ¶
NotEqual asserts actual is not equal to expected
func NotPanics ¶
NotPanics asserts fn() does not panic
func NotZero ¶
NotZero asserts value is not the zero value
func Panics ¶
Panics asserts fn() panics
func Zero ¶
Zero asserts value is the zero value
Source Files ¶
- Version
- v0.3.1
- Published
- Jan 29, 2023
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 4 hours ago –
Tools for package owners.