s-test
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTesting WoW Addons
WoW插件测试
Expert guidance for testing WoW addons using Sandbox, Desktop, and In-Game methods.
本指南提供使用Sandbox、桌面端和游戏内方法测试WoW插件的专业指导。
Related Commands
相关命令
- c-test - Run unit tests workflow
- c-review - Full code review (includes test step)
- c-test - 运行单元测试工作流
- c-review - 完整代码评审(包含测试环节)
CLI Commands (Use These First)
CLI命令(优先使用)
MANDATORY: Always use CLI commands before manual exploration.
| Task | Command |
|---|---|
| Generate Stubs | |
| Run Sandbox Tests | |
| Run Busted Tests | |
| Test Coverage | |
| Sandbox Status | |
强制要求:在手动操作前,请始终优先使用CLI命令。
| 任务 | 命令 |
|---|---|
| 生成桩代码 | |
| 运行Sandbox测试 | |
| 运行Busted测试 | |
| 测试覆盖率 | |
| Sandbox状态 | |
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
- Sandbox测试 — 基于生成的WoW API桩代码进行快速离线测试
- 桌面端测试(Busted) — 配合自定义模拟的集成测试
- 游戏内测试 — 通过MechanicLib注册实现运行时验证
- 覆盖率分析 — 识别未被测试的代码路径
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 |
| 请求类型 | 参考文档 |
|---|---|
| Sandbox、Busted、游戏内测试指南 | ../../docs/integration/testing.md |
| Busted测试用例模式 | references/busted-patterns.md |
| 模拟WoW API | references/wow-mocking.md |
| MechanicLib测试注册 | ../../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.
- Sandbox(核心):为业务逻辑提供快速反馈。
- 桌面端(集成):测试模块间的交互逻辑。
- 游戏内(验证):基于真实API进行最终校验。
Example Sandbox Test
Sandbox测试示例
lua
describe("MyAddon Core", function()
it("calculates values correctly", function()
local result = Core.Calculate(10, 20)
assert.equals(30, result)
end)
end)lua
describe("MyAddon Core", function()
it("calculates values correctly", function()
local result = Core.Calculate(10, 20)
assert.equals(30, result)
end)
end)Running Tests
运行测试
bash
undefinedbash
undefinedGenerate stubs once
一次性生成桩代码
mech call sandbox.generate
mech call sandbox.generate
Run tests frequently
频繁运行测试
mech call sandbox.test -i '{"addon": "MyAddon"}'
undefinedmech call sandbox.test -i '{"addon": "MyAddon"}'
undefined