Agent Skills
› shinpr/claude-code-workflows
› test-implement
test-implement
GitHub用于实现React/TypeScript的前端测试,包括单元测试、集成测试及浏览器E2E测试。提供配置好的运行器、Mock和Harness支持,遵循AAA结构等最佳实践,适用于生成或完善前端测试骨架。
Trigger Scenarios
创建前端组件测试
编写集成测试
实施浏览器级E2E测试
生成测试骨架代码
Install
npx skills add shinpr/claude-code-workflows --skill test-implement -g -y
SKILL.md
Frontmatter
{
"name": "test-implement",
"description": "Implements React\/TypeScript unit, integration, and browser E2E tests with the repository's configured runner, mocks, setup, and browser harness. Use when creating or completing frontend tests and generated test skeletons."
}
Test Implementation Patterns
Reference Selection
| Test Type | Reference | When to Use |
|---|---|---|
| Unit / Integration | references/frontend.md | Implementing React component tests with the repository's configured runner and network mocking layer |
| E2E | references/e2e.md | Implementing browser-level E2E tests in the existing harness, or Playwright when the approved work introduces a harness |
Common Principles
AAA Structure
All tests follow Arrange-Act-Assert:
- Arrange: Set up preconditions and inputs
- Act: Execute the behavior under test
- Assert: Verify the expected outcome
Test Independence
- Each test runs independently without depending on other tests
- No shared mutable state between tests
- Deterministic execution — mock random and time dependencies
Naming
- Test names describe expected behavior from user perspective
- One test verifies one behavior
Version History
-
416af89
Current 2026-08-12 16:36
优化了测试独立性原则的描述,将 'no random or time dependencies without mocking' 调整为更清晰的表述,并重构提交日志以保留提示词意图。
-
56ab6c1
2026-07-19 22:41
优化技能指导,使其更具项目感知能力(project-aware)
- 66e3b29 2026-07-05 11:57


