testing-conventions

Enforces behavioral test naming and value-versus-behavior testing conventions in test suites.

1|1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/williamthorsen/codeassembly --skill testing-conventions-williamthorsen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-conventions
Source: https://github.com/williamthorsen/codeassembly/tree/main/packages/agents/content/skills/testing-conventions
Command: npx skills add https://github.com/williamthorsen/codeassembly --skill testing-conventions-williamthorsen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams accumulate brittle tests that pin incidental values, duplicate existing gates, or assert that removed code stays removed, making suites expensive to maintain without catching real regressions. ## Core Features & Use Cases - Behavior-versus-value discipline: Defines rules for deciding whether a test guards an actual behavior or merely pins a value that review already covers. - Test naming standards: Enforces specific, conditional, outcome-focused test names using the "when/if [condition], [outcome]" formula and bans vague patterns like "handles X". - Test structure guidance: Promotes parameterized tests with it.each, shared-setup helpers, and minimal mocking so variation reads as variation. - Use Case: When adding a test after removing an event type, the Skill directs you to assert the replacement behavior rather than writing a permanent not.toContain guard against the deleted string. ## Quick Start Review my new test file against the testing conventions and tell me which assertions pin values instead of guarding behaviors.

Frequently Asked Questions about testing-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write good test names for unit tests?

Use the formula "when/if [condition], [action/outcome]" so each name states a specific condition and result, like "returns 0 when map is empty". Avoid vague terms such as "handles", "correctly", or "properly", and omit the word "should".

When should I not write a test for a code change?

Skip a test when the change adds no runtime behavior, when an existing gate like the compiler or linter already reproduces the failure condition, or when the test would only pin a value such as message wording or config contents that review already guards.

Should I add a test asserting removed code stays removed?

No. A permanent assertion that a deleted string or variant is absent encodes history rather than contract and guards no regression class. Verify the removal once as a pre-merge check, and write a positive test for the replacement behavior instead.

When should I use it.each instead of separate test blocks?

Use it.each when adjacent tests differ only in a small set of inputs and share a structurally identical body, so the variation reads as a table. Keep separate it blocks when the tests express genuinely distinct behavioral claims or have different assertion shapes.

What should I do when a wording change breaks a test?

Do not re-pin the new wording. Loosen the assertion to match only the durable fragment that identifies the behavior, or drop the assertion entirely if no behavior depends on the exact text.