testinglisted
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