← ClaudeAtlas

padosoft-test-integritylisted

Use this skill when writing or reviewing a test, and whenever a suite is suspicious: a test that passes whatever the code does, one that went green without the fix, an ordering test that never fails, a suite that passes alone and fails in sequence or in a different order, a flaky test blamed on CI. It checks that the body exercises what the name promises, that ordering assertions are strict, that global state is restored, that a failure-path test actually fires the failure, and that the assertion could fail at all. Do not use it to choose a test framework, to design a test strategy or coverage targets, or to debug a failing application bug.
padosoft/skills · ★ 1 · Testing & QA · score 80
Install: claude install-skill padosoft/skills
# Test integrity **A test that cannot fail is worse than no test**: it costs the same to run, and it buys a confidence nobody earned. These are the ways a test passes without testing anything — all found in real review, all green. --- ## 1. The name and the body must match The assertion on the last line is the direct consequence of the action on the first. ```tsx // ❌ nothing is edited, so "after edit" is never exercised it("enables Save after edit", () => { render(<Form />); expect(screen.getByRole("button", { name: "Save" })).toBeDisabled(); }); // ✅ it("enables Save after edit", async () => { render(<Form />); await user.type(screen.getByLabelText("Title"), "x"); expect(screen.getByRole("button", { name: "Save" })).toBeEnabled(); }); ``` A name that promises a transition (`after`, `when`, `once`, `on`) and a body with no action is the single most common instance. ## 2. Ordering tests need strict comparisons and monotonic fixtures ```ts // ❌ passes under either order expect(last).toBeGreaterThanOrEqual(first); // ✅ fails if the order reverses expect(second).toBeGreaterThan(first); ``` And the **fixtures must be strictly monotonic**: three rows with the same timestamp make any ordering assertion vacuous, however strict the operator. The test to run on yourself: *reverse the expected order in the fake response — does the test fail?* If it does not, it is not testing ordering. ## 3. Global state is restored Environment variables, container bindin