Testing
Test game logic, lobbies, multiplayer, and integration.
Game logic
- Prefer pure functions for rules; keep
GameEnginethin. - Use
sw_plugin::NopHostto assert broadcasts /complete_matchcalls. - Cover illegal moves, turn order, disconnect/forfeit, and finish conditions.
cd my-game && cargo testLobby flow
Manual or scripted against local API:
- Auth → create free lobby → second user joins → ready → start.
- Paid path: fund custodial wallets on test/mainnet config you use locally, then vault join + join API.
Multiplayer
- Two browsers (or profiles) on the same
NEXT_PUBLIC_APP_URL. - Confirm both receive state after each action and after reconnect.
- Kill one tab mid-match and verify quit handling.
Integration
cargo check -p sw-serverwith your crate registered.- Frontend: Room mounts for your
gameId, playable badge shows. - Smoke: create → play → finish → (paid) claim path once on a funded environment.