← ClaudeAtlas

testinglisted

Language-agnostic testing standards for writing effective tests. Covers test structure, what to test, mocking, and coverage goals. Make sure to use this skill whenever writing tests, doing TDD, reviewing test coverage, or when code changes should have tests added; testing standards apply to all code, not just dedicated test tasks. Language-specific skills, if present, may override these defaults.
johanthoren/jeff · ★ 2 · Testing & QA · score 68
Install: claude install-skill johanthoren/jeff
# Testing Standards Language-agnostic defaults. Language-specific skills override where they conflict. **Golden Rule**: If you can't test it easily, refactor it. ## Structure and Naming - Arrange, act, assert: set up the data, execute the code, verify the result. One behavior per test. - Names state the expectation: `validateEmail returns false for invalid format`, not `it works` or `test user`. ## What to Test - **DO**: happy path; edge cases (boundaries, empty, null); error cases (invalid input, failures); business logic; public APIs. - **DON'T**: third-party libraries; framework internals; simple getters/setters; private implementation details. ## Coverage Coverage is an outcome of testing the right intersections, not a target to chase. Not every line, and not every one-liner, needs a test; a one-line pass-through does not. Cover each behavior and its real edges; a task's acceptance criteria are the floor. ## Principles - **Test behavior, not implementation**: focus on what, not how. Assert results, never that a mock was called with particular arguments: `expect(mock).toHaveBeenCalledWith(...)` pins procedure and goes red on a behavior-preserving refactor. - **Would it survive a refactor?** If a behavior-preserving refactor would turn the test red, it tests procedure; rewrite it to assert the result. Procedure-coupled tests lock in design flaws. - **Mock through injected boundaries**: dependency injection makes a hand-rolled fake (`{ findById: () => fixture }`) s