# Play the whole game before shipping

Use scenarios, invariants, seeded playthroughs, and replay to exercise your rules.

```ts
import { playtest, simulate } from '@tabletopwithfriends/sdk'
import { game } from './game'

const test = playtest(game)
test.act('increment')
const result = simulate(game, { seed: 'regression-1' })
```

## Test decisions, not implementation details

Cover invalid inputs, stale choices, wrong actors, hidden information, partial progress, and completion. For economies and inventories, assert conservation. For interruptible actions, check that returning from a child decision restores its parent.

## Upgrade with evidence

Run the same saved scenarios and command histories against a candidate SDK upgrade. A passing TypeScript check does not establish behavioral compatibility. Keep the previous dependency lockfile until the upgrade's tests pass.