hooks

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package hooks provides a first public hook-test harness for js/wasm tests.

It builds on testkit/render so custom hooks and hook-driven state flows can be exercised without writing a bespoke host component in every test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Harness

type Harness[T any] struct{}

Harness wraps one rendered hook instance.

func RenderHook

func RenderHook[T any](parseTb testing.TB, parseHook func() T) *Harness[T]

RenderHook requires a js/wasm test environment because interactive hooks only use the real runtime on browser-targeted builds.

func (*Harness[T]) Act

func (parseH *Harness[T]) Act(parseFn func())

func (*Harness[T]) Cleanup

func (parseH *Harness[T]) Cleanup()

func (*Harness[T]) Current

func (parseH *Harness[T]) Current() T

func (*Harness[T]) Flush

func (parseH *Harness[T]) Flush()

func (*Harness[T]) Rerender

func (parseH *Harness[T]) Rerender()

Jump to

Keyboard shortcuts

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