# Testing

## Test outside the app with the dev mock

Enable the [dev mock](./guides/dev-mock.md) and run your game in a plain browser.
Then use the included interactive harness to exercise every method:

👉 [Open the test harness](pathname:///examples/test-game.html)

It shows an **in-app** vs **dev mock** badge and logs each SDK response, with
buttons for `getCoins`, `spendCoins`, `earnCoins`, `getCoinValue`, `getPlayer`,
and `storage` save/load.

## Pre-submission checklist

Before submitting your game to Gamma Games, verify:

- [ ] Game loads and plays **without** the SDK (outside the app)
- [ ] After `gamma.ready()`, coin features are gated on `gamma.isInApp`
- [ ] `getCoins` shows the correct balance in-app
- [ ] `spendCoins` deducts and grants the reward only on `ok: true`
- [ ] `spendCoins` over the balance shows an error, balance unchanged
- [ ] Invalid `reason` (uppercase/spaces) is rejected
- [ ] `getCoinValue` returns `usdPerCoin` + display metadata
- [ ] `gamma.storage.save` persists across app restarts (in-app) and reloads (offline)
- [ ] `gamma.storage.load` returns `null` for a fresh player
- [ ] Saves stay under 100 KB and carry a `schemaVersion`
- [ ] The game shows friendly messages, never raw error codes
- [ ] The dev mock is **disabled** in the production build
