What problem does it solve?
Writing reliable Cairo tests for Dojo models and systems is repetitive and error-prone, and developers need a consistent pattern for unit and integration tests that exercise world state, permissions, and cheat-code scenarios. This Skill provides a structured way to generate tests that set up spawn_test_world, manipulate execution context, and assert state transitions so bugs are caught early.
Core Features & Use Cases
- Structured Test Generation: Produces unit tests inside model files and integration tests in a tests/ directory following Dojo conventions.
- Deterministic World Setup: Uses spawn_test_world, namespace and contract defs, and world.sync_perms_and_inits to create reproducible test environments.
- Cheat Codes & Assertions: Demonstrates use of testing cheat codes (caller, contract address, timestamp, block number) and common assertions for read/write/erase model operations.
- Use Cases: Verify move system behavior, test Position model read/write semantics, assert expected panics, and validate multi-player state isolation.
Quick Start
Generate tests for the move system that verify position updates and move consumption using spawn_test_world and clear assertions.