Skip to content

Function: whenState()

whenState<T>(cell, states, options?): Promise<CellState>

Defined in: testing.ts:103

Wait until the cell reaches one of the given states; resolves with the state it reached. Times out with a diagnostic — the state it was stuck in and, if errored, the error — because "timed out" alone is the worst message a dataflow test can produce.

Type Parameters

T

T

Parameters

cell

Cell<T>

states

CellState | readonly CellState[]

options?

WaitOptions = {}

Returns

Promise<CellState>