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

Functions

func Contains

func Contains(tb testing.TB, collection, item interface{}) bool

Contains asserts item is contained by collection

func Equal

func Equal(tb testing.TB, expected, actual interface{}) bool

Equal asserts actual is equal to expected

func Error

func Error(tb testing.TB, err error) bool

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

func NoError(tb testing.TB, err error) bool

NoError asserts err is nil

func NotContains

func NotContains(tb testing.TB, collection, item interface{}) bool

NotContains asserts item is not contained by collection

func NotEqual

func NotEqual(tb testing.TB, expected, actual interface{}) bool

NotEqual asserts actual is not equal to expected

func NotPanics

func NotPanics(tb testing.TB, fn func()) bool

NotPanics asserts fn() does not panic

func NotZero

func NotZero(tb testing.TB, value interface{}) bool

NotZero asserts value is not the zero value

func Panics

func Panics(tb testing.TB, fn func()) (panicked bool)

Panics asserts fn() panics

func Zero

func Zero(tb testing.TB, value interface{}) bool

Zero asserts value is the zero value

Source Files

assert.go

Version
v0.3.1
Published
Jan 29, 2023
Platform
js/wasm
Imports
5 packages
Last checked
4 hours ago

Tools for package owners.