testutil

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package testutil provides utility functions for testing WebAssembly modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr

func Ptr[i any](x i) *i

Ptr returns a pointer to the input value.

func WaitForGlobalFunc

func WaitForGlobalFunc(t *testing.T, funcName string, opts ...WaitForGlobalFuncOption)

WaitForGlobalFunc waits for a global JavaScript function to be defined, or times out after the specified duration. It can also run custom assertions.

Types

type WaitForGlobalFuncOption

type WaitForGlobalFuncOption func(*waitForGlobalFuncConfig)

WaitForGlobalFuncOption is a configuration option for the WaitForGlobalFunc function.

func WithAssertion

func WithAssertion(assertion func(js.Value) assert.ValueAssertionFunc) WaitForGlobalFuncOption

WithAssertion adds a custom assertion to the WaitForGlobalFunc function.

func WithTimeout

func WithTimeout(timeout time.Duration) WaitForGlobalFuncOption

WithTimeout sets the timeout for the WaitForGlobalFunc function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL