Skills for AI coding agents with best testing practices based on amazing articles by Artem Zakharchenko on EpicWeb. Source articles available in the src/ folder.
Install with npm:
npx skills add MonsterDeveloper/testing-skills --skill testing-best-practicesor bun:
bunx skills add MonsterDeveloper/testing-skills --skill testing-best-practicestesting-best-practices/
├── SKILL.md # Core principles and patterns
└── references/
├── vitest-patterns.md # Vitest config, async, mocks
└── component-testing.md # Component/UI test patterns
The skill is designed for context window efficiency:
- SKILL.md (~200 lines) contains essential principles loaded when the skill triggers
- Reference files are loaded only when needed for detailed patterns
- Test intentions, not implementations — Tests should fail only when user-facing behavior breaks
- The Golden Rule of Assertions — A test must fail if, and only if, the intention behind the system is not met
- Don't assert on requests — Validate in mocks, assert on UI state
- Use real browsers — JSDOM creates false confidence; prefer Vitest Browser Mode
- Flat, explicit tests — Avoid nested
describeand scattered hooks - Code coverage is a tool, not a target — Never let it drive testing decisions
- Test structure (Setup → Action → Assertion)
- Test boundaries and mocking principles
- Assertion patterns (
.resolves,.toBeVisible, inverse assertions) - Mock management (
.mockClear()vs.mockReset()vs.mockRestore()) - S.M.A.R.T. framework for flaky tests
- Vitest Browser Mode setup and patterns
- Component testing with MSW
- Disposable objects for test cleanup
Based on 18 articles from EpicWeb covering:
- The True Purpose of Testing
- The Golden Rule of Assertions
- Anatomy of a Test
- Test Boundaries
- Implicit Assertions
- Inverse Assertions
- Vitest Defaults and Browser Mode
- Why Not JSDOM
- And more...