asyrafhussin avatar

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-code

Installs 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

PriorityCategoryImpactPrefix
1Test StructureCRITICALstruct-
2Test IsolationCRITICALiso-
3AssertionsHIGHassert-
4Test DataHIGHdata-
5MockingMEDIUMmock-
6CoverageMEDIUMcov-
7PerformanceLOWperf-

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
1pluginagentmarketplace avatarjava-testingpluginagentmarketplace/custom-plugin-javaTest Java applications - JUnit 5, Mockito, integration testing, TDD patterns909skills.sh installs
2mindrally avatarjestmindrally/skillsJest testing best practices for JavaScript and TypeScript applications, covering test structure, mocking, and assertion patterns.896skills.sh installs
3encoredev avatarencore-testingencoredev/skillsWrite or run automated tests for Encore.ts code with `encore test` and vitest/jest. Covers isolated per-test databases, calling handlers directly, and `describe829skills.sh installs
4testdino-hq avatarplaywright-clitestdino-hq/playwright-skillAutomates browser interactions for testing and validating your own web applications using playwright-cli. Use when you need terminal-first browser control for n815skills.sh installs
5hairyf avatarvitesthairyf/skillsVitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filteri789skills.sh installs
6adobe avatarappbuilder-testingadobe/skillsGenerate and run tests for Adobe App Builder actions and UI components. Scaffolds Jest unit tests, integration tests against deployed actions, contract tests fo766skills.sh installs