Imported from ReaperOAK/ForgeOS (
plugin/forgeos/skills/testing/SKILL.md). Install upstream withnpx skills add ReaperOAK/ForgeOS --skill testing. Copyright stays with the author.
Overview
Testing best practices including unit testing, integration testing, E2E testing with Playwright, and test writing guidelines for TypeScript.
Testing Best Practices
When to Use
- Writing unit tests for new code
- Creating integration tests for APIs
- Setting up E2E tests with Playwright
- Following TDD red-green-refactor cycle
Test Types
- Unit Tests — Test individual functions/methods in isolation
- Integration Tests — Test component interactions and API endpoints
- E2E Tests — Test complete user flows with Playwright
- Mutation Tests — Verify test quality by introducing mutations
Key Practices
- Arrange-Act-Assert pattern
- Test edge cases and error scenarios
- Mock external dependencies
- Descriptive test names:
should [expected behavior] when [condition]
Resources
See the ../qa/references/ directory for:
- QA Best Practices and Strategy Guide (chunks 1-4)
- QA Agent reference (chunks 1-2)
- Playwright testing guide
- Test writing guidelines
Rules
- Follow the conventions defined in this skill
- Apply these patterns consistently across all relevant code