Skip to content

TestTable

Defined in: testing/test-table.ts:37

A table driven directly, without sockets, for testing game rules. Checks are always on: frozen state, JSON validation and the nondeterminism guard.

G extends AnyGame

readonly clock: FakeClock

Defined in: testing/test-table.ts:38


readonly events: RecordedEvent[] = []

Defined in: testing/test-table.ts:42

Ephemeral events emitted by the game, in order.


readonly runtime: TableRuntime

Defined in: testing/test-table.ts:46


readonly wallet: Wallet

Defined in: testing/test-table.ts:40

The wallet behind ctx.wallet (a MemoryWallet unless you passed one).


readonly walletErrors: object[]

Defined in: testing/test-table.ts:50

Deferred wallet ops that failed after retries (a game bug, such as a reused key).

error: unknown

op: WalletOp

get log(): readonly LogEntry[]

Defined in: testing/test-table.ts:118

readonly LogEntry[]


get meta(): TableMeta

Defined in: testing/test-table.ts:112

TableMeta


get rev(): number

Defined in: testing/test-table.ts:109

number


get seats(): SeatInfo[]

Defined in: testing/test-table.ts:115

SeatInfo[]


get state(): GameState<G>

Defined in: testing/test-table.ts:106

The raw committed state (what the server holds, not what clients see).

GameState<G>

act<K>(seat, name, ...input): Promise<Json | undefined>

Defined in: testing/test-table.ts:136

Runs an action as seat and waits for follow-ups (round closes, auto-start).

K extends string

number

K

...InputArgs<G, K>

Promise<Json | undefined>


advance(ms): Promise<void>

Defined in: testing/test-table.ts:190

Moves the fake clock forward, firing due timers (turn timeouts, rounds).

number

Promise<void>


disconnect(seat): Promise<void>

Defined in: testing/test-table.ts:173

number

Promise<void>


playerAt(seat): string

Defined in: testing/test-table.ts:123

The player id sitting at seat (set by sit).

number

string


reconnect(seat): Promise<void>

Defined in: testing/test-table.ts:178

number

Promise<void>


sit(seat, playerId?, name?): Promise<void>

Defined in: testing/test-table.ts:154

number

string = ...

string = ...

Promise<void>


stand(seat): Promise<void>

Defined in: testing/test-table.ts:167

number

Promise<void>


start(): Promise<void>

Defined in: testing/test-table.ts:184

Starts a table whose game sets autoStart: false.

Promise<void>


verifyReplay(): Promise<void>

Defined in: testing/test-table.ts:198

Replays this table's log from scratch and asserts it reproduces the current state exactly (ADR 0006). Call it at the end of any test.

Promise<void>


viewOf(seat): GameView<G>

Defined in: testing/test-table.ts:130

What seat (or a spectator) sees: the game's view() output.

number | "spectator"

GameView<G>