# Test Helpers

Generate engine-specific test helper libraries, assertion utilities, factory...

- Repository: https://github.com/Donchitos/Claude-Code-Game-Studios (32144 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-19
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Donchitos/Claude-Code-Game-Studios --skill test-helpers -g -a claude-code -y`
Codex: `npx skills add Donchitos/Claude-Code-Game-Studios --skill test-helpers -g -a codex -y`
Cursor: `npx skills add Donchitos/Claude-Code-Game-Studios --skill test-helpers -g -a cursor -y`
Gemini CLI: `npx skills add Donchitos/Claude-Code-Game-Studios --skill test-helpers -g -a gemini-cli -y`

## Description

Generate engine-specific test helper libraries, assertion utilities, factory functions, mocks in the engine's test folder. Reduces boilerplate.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

!`bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation`

**Automation mode**: Resolve `modes.automation` (`project.local.yaml` →
`project.yaml` → default `collaborative`). Every `AskUserQuestion` call and
every file write follows `.claude/docs/automation-modes.md`
(collaborative asks always · guided major-only · autonomous logs and proceeds;
`automation_always_ask` categories always prompt).

# Test Helpers

Writing test cases is faster and more consistent when common setup, teardown,
and assertion patterns are abstracted into helpers. This skill generates a
`tests/helpers/` library tailored to the project's actual engine, language,
and systems, so every developer writes less boilerplate and more assertions.

**Output:** engine-specific helper files in the engine's **helper root**, the only place its test runner compiles them (`.claude/docs/directory-structure.md`):

| Engine | Helper root |
|---|---|
| Godot | `tests/helpers/` |
| Unity | `Assets/Tests/EditMode/Helpers/`, inside the `EditModeTests` assembly `/test-setup` creates. If PlayMode tests need the same helpers, ask before creating `Assets/Tests/Helpers/TestHelpers.asmdef` and referencing it from both test assemblies. |
| Unreal | `Source/<Module>/Private/Tests/Helpers/` |

`tests/helpers/` below means the helper root for the project's engine.

**When to run:**
- After `/test-setup` scaffolds the framework (first time)
- When multiple test files repeat the same setup boilerplate
- When starting to write tests for a new system

---

## Assertions: use the project's test framework, never bare `assert()`

**Generated helpers must assert through the configured test framework's assertion
API**, resolved from `testing.framework`, not through GDScript's built-in
`assert()`.

Two things go wrong with a bare `assert()` in a helper, and both are silent:

The rest: https://github.com/Donchitos/Claude-Code-Game-Studios/blob/HEAD/.claude/skills/test-helpers/SKILL.md
