
Testing Best Practices
A comprehensive testing reference that covers the fundamentals through 34 rules organized by priority, from critical test structure and isolation patterns down to performance optimizations. You'll want this when writing new tests, reviewing PRs, or setting up testing infrastructure. It's opinionated about the AAA pattern, test independence, and strategic mocking at boundaries rather than everywhere. The examples use TypeScript with Jest/Vitest, and it's honest about controversial topics like why 100% coverage shouldn't be your goal. The rule prefixes make it easy to scan for what matters most when you're in a hurry.
- skills.sh installs
- 957
- GitHub stars
- 102
- last updated
- Aug 21, 2026
Install
$ npx -y skills add asyrafhussin/agent-skills --skill testing-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Testing Best Practices
Unit testing, integration testing, and TDD principles for reliable, maintainable test suites. Contains 34 rules across 7 categories using TypeScript with Jest/Vitest.
Metadata
- Version: 2.0.0
- Rule Count: 34 rules across 7 categories
- License: MIT
When to Apply
Reference these guidelines when:
- Writing unit or integration tests
- Reviewing test code quality
- Improving test coverage strategy
- Setting up testing infrastructure
- Debugging flaky or slow tests
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Test Structure | CRITICAL | struct- |
| 2 | Test Isolation | CRITICAL | iso- |
| 3 | Assertions | HIGH | assert- |
| 4 | Test Data | HIGH | data- |
| 5 | Mocking | MEDIUM | mock- |
| 6 | Coverage | MEDIUM | cov- |
| 7 | Performance | LOW | perf- |
Quick Reference
1. Test Structure (CRITICAL)
Sponsors
Details
- Repository
- github.com/asyrafhussin/agent-skills
- Categories
- Testing & QA, Git & Pull Requests, Documentation, Code Review & Quality, AI & Agent Building
- First seen
- Jun 3, 2026
More from asyrafhussin/agent-skills
All 14- Web Design Guidelines948
- Git Workflow890
- State Management834
- Php Best Practices3.8K
- React Vite Best Practices3K
- Laravel Best Practices2.4K
- Laravel Inertia React2K
- Clean Code Principles1.9K
- Typescript React Patterns1.1K
- Laravel Database Optimization1.1K
- Laravel Owasp Security1.1K
- Tailwind Best Practices1K
- Api Design Patterns984