← ClaudeAtlas

testinglisted

How to WRITE real, maintainable tests in any stack — assertions that fail when the code is broken, the test pyramid and AAA structure, behavior-over-implementation, mocking discipline, fixtures, coverage that means something, and the ship gates (test-count-never-decrease, no self-mocking, prove-RED-first). Language-generic with concrete examples in TypeScript/JavaScript, Python, Rust, and Go. Use when asked to "add tests", "write a test", "improve coverage", "fix a flaky test", "how do I test X", when turning a hollow assertion into a real one, deciding what layer a test belongs in, or when a change must not drop test quality. The construction counterpart to the crucible-detective agent's fraud hunt.
nxtg-ai/forge-plugin · ★ 5 · Testing & QA · score 73
Install: claude install-skill nxtg-ai/forge-plugin
# Testing — Writing Tests That Catch Real Bugs A test that stays green while the code is broken is **worse than no test** — it manufactures false confidence. This skill is the *construction* companion to the crucible-detective agent: - **crucible-audit** skill — *detection*: the 8 fraud patterns (hollow assertions, mock proliferation, dead tests, coverage-config lies) + the language matrix. - **testing** (this skill) — *construction*: principles + how to write a test that actually fails on a real bug, in whatever stack the project uses. Guidance is language-generic; examples cover the stacks Forge users build in — TypeScript/JavaScript, Python, Rust, Go. Match the project before you copy a snippet. ## The one rule that makes a test real Every test must **fail when you break the thing it names.** Before you trust a new test, prove it: change the production code to be wrong, re-run, confirm **RED**, then revert. An assertion that survives a deliberately broken implementation is theater. ```js // THEATER — passes even if computeDiscount() returns garbage expect(result).toBeDefined(); expect(result.total).toBeTruthy(); // REAL — pins the actual contract; breaks the instant the math changes expect(result.total).toBe(87.5); expect(result.appliedRule).toBe('bulk-10pct'); expect(result.lineItems).toHaveLength(3); ``` ### Hollow tells to avoid, by stack crucible-audit hunts these — don't write them. An assertion that cannot fail on a *wrong value* is not a test. | Stack