testing-best-practice
Installation
SKILL.md
Testing Best Practice
Instructions
When the user asks for help with tests (writing new tests, improving existing ones, or defining testing standards), follow these rules:
-
Test intent, not implementation
- Make tests read like requirements.
- Assert observable behaviour: return values, DOM, side-effects, and public contracts.
- Avoid asserting private state, internal variables, or exact call sequences unless the behaviour requires it.
-
Favour high-signal, low-maintenance tests
- A test should fail only when the behavioural contract changes.
- Use the smallest, clearest input that still demonstrates the behaviour.
- Name tests in real-world language, e.g.:
it("allows a customer to update their email", async () => {})