← Recipe: persist and restore state

5. Check and run

luastra/state · luastra/host · app.resolve · about 15 minutes
save → change → load → reload → load

Automated tests verify deterministic state logic; the preview verifies the browser storage adapter and asynchronous resolve path.

When to use it

Run from storage-recipe after all three files are saved.

  • check must report result=PASS and test must report tests=1 and passed=1.
  • Loading before the first save may produce a bounded failure or empty payload; keep the current count.
  • A browser-host pass does not prove persistence in every desktop or mobile host.

Focused example

luastra check
luastra test
luastra run
# Add twice, Save, Add again, then Load: expect 2.
# Reload the page, press Load again, and expect 2.

Complete inventory

View all pages in Recipe: persist and restore state
← Previous: 4. Replace tests/smoke.luauNext: 6. Understand and extend →