s-test
Write and run unit tests for WoW addons using Busted and the Mechanic test framework. Covers test structure, mocking WoW APIs, and coverage analysis. Use when adding tests, fixing bugs with regression tests, or improving coverage. Triggers: test, unit test, coverage, Busted, mock, TDD, sandbox.
When & Why to Use This Skill
This Claude skill empowers World of Warcraft (WoW) addon developers to implement robust unit testing workflows using the Busted and Mechanic frameworks. It streamlines the creation of test structures, provides expert guidance on mocking complex WoW APIs, and enables comprehensive coverage analysis to ensure addon stability and performance across Sandbox, Desktop, and In-Game environments.
Use Cases
- Implementing Test-Driven Development (TDD) for new WoW addon features to ensure logic correctness before deployment.
- Creating regression tests to verify bug fixes and prevent future breakages in complex addon modules.
- Mocking specific World of Warcraft API behaviors to test addon functionality without needing to launch the game client.
- Performing code coverage analysis to identify untested logic paths and improve the overall reliability of the addon codebase.
- Automating the generation of WoW API stubs for fast, offline sandbox testing of business logic.
| name | s-test |
|---|---|
| description | > |
| Triggers | test, unit test, coverage, Busted, mock, TDD, sandbox. |
Testing WoW Addons
Expert guidance for testing WoW addons using Sandbox, Desktop, and In-Game methods.
Related Commands
CLI Commands (Use These First)
MANDATORY: Always use CLI commands before manual exploration.
| Task | Command |
|---|---|
| Generate Stubs | mech call sandbox.generate |
| Run Sandbox Tests | mech call sandbox.test -i '{"addon": "MyAddon"}' |
| Run Busted Tests | mech call addon.test -i '{"addon": "MyAddon"}' |
| Test Coverage | mech call addon.test -i '{"addon": "MyAddon", "coverage": true}' |
| Sandbox Status | mech call sandbox.status |
Capabilities
- Sandbox Testing — Fast, offline tests using generated WoW API stubs
- Desktop Testing (Busted) — Integration tests with custom mocks
- In-Game Testing — Runtime verification via MechanicLib registration
- Coverage Analysis — Identify untested code paths
Routing Logic
| Request type | Load reference |
|---|---|
| Sandbox, Busted, In-Game guides | ../../docs/integration/testing.md |
| Busted spec patterns | references/busted-patterns.md |
| Mocking WoW APIs | references/wow-mocking.md |
| MechanicLib test registration | ../../docs/integration/mechaniclib.md |
Quick Reference
Recommended Workflow
- Sandbox (Core): Fast feedback for business logic.
- Desktop (Integration): Test interactions between modules.
- In-Game (Verification): Final check against live APIs.
Example Sandbox Test
describe("MyAddon Core", function()
it("calculates values correctly", function()
local result = Core.Calculate(10, 20)
assert.equals(30, result)
end)
end)
Running Tests
# Generate stubs once
mech call sandbox.generate
# Run tests frequently
mech call sandbox.test -i '{"addon": "MyAddon"}'