dojo-test

Generate Dojo model and system tests using Cairo and Starknet cheat codes.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/Await-0x/stark-tycoon --skill dojo-test-await-0x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dojo-test
Source: https://github.com/Await-0x/stark-tycoon/tree/main/.agents/skills/dojo-test
Command: npx skills add https://github.com/Await-0x/stark-tycoon --skill dojo-test-await-0x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing comprehensive tests for Dojo models and systems, ensuring the correctness and reliability of your Starknet game logic.

Core Features & Use Cases

  • Automated Test Generation: Creates test files with necessary setups like spawn_test_world(), model/system registration, and assertion functions.
  • Cheat Code Integration: Demonstrates the use of Starknet cheat codes for manipulating execution context (caller address, timestamp, etc.).
  • Use Case: When developing a new combat system for your game, use this Skill to automatically generate unit and integration tests that verify damage calculations, state changes, and win/loss conditions.

Quick Start

Use the dojo-test skill to write tests for the player movement system.

Frequently Asked Questions about dojo-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for Dojo models and systems in Cairo?

To write unit tests for Dojo models and systems, you use Cairo's testing framework combined with Dojo's utilities to verify game logic. This involves setting up test files with spawn_test_world() and registering models to assert state changes.

How do I test Dojo game logic and state changes on Starknet?

You test Dojo game logic and state changes by generating integration tests that verify calculations and conditions within the Starknet ecosystem. These tests use assertions to ensure system correctness after executing specific game actions.

Can I use Starknet cheat codes to manipulate execution context in Dojo tests?

Yes, you can use Starknet cheat codes in Dojo tests to manipulate the execution context. This allows you to override values like the caller address or timestamp during testing to verify specific system behaviors and edge cases.

What is the process to set up a test world for Dojo smart contracts?

Setting up a test world for Dojo smart contracts requires calling spawn_test_world() in your test file. This initializes the testing environment, allowing you to register models and systems before running assertions on game logic.

How do I verify win or loss conditions in a Dojo combat system?

You verify win or loss conditions in a Dojo combat system by generating integration tests that assert damage calculations and state changes. This confirms the game logic correctly determines outcomes based on the executed actions.