Better with Kent · draft

I Delete Tests Every Night

On purpose

+122
−703
same coverage

Every morning

A PR that deletes tests

Not flaky. Not broken. Low-signal — tiny cases, wrappers, and duplicates the suite shouldn't carry forever.

Better with Kent

Tests are expensive

  • Agents make writing them cheap
  • They make overwriting the suite easy
  • Without a bar, you drown overnight

The trap AI made worse

Agents love tiny tests

  • One assertion per test
  • Thin wrappers around wrappers
  • Pin every error string
  • Edge cases that won't happen twice

Here's the thing

Green checks ≠ confidence

More passing tests can mean a heavier suite — slower, scarier to change, and still missing the journey that matters.

The bar

Fewer, longer tests

  • One workflow · many related assertions
  • Like a manual tester's script
  • Multiple assertions in one test are a feature

Write it down

Principles agents can read

  • Flat files · no nested describe theater
  • Inline setup · no shared mutable soup
  • Don't test what TypeScript already proves
  • Assert behavior — not instructional copy

testing-principles.md

Demo

kody#603

Community package work landed. Agents added regression and wrapper tests. Morning pass cleaned them up.

github.com/kentcdodds/kody/pull/603

Files changed

+122 / −703

−581 net lines
13 files touched

Same behavioral coverage at the service / integration layer.

What got deleted

Low-signal / duplicate

  • Trivial URLSearchParams wrapper test
  • Thin MCP capability wrappers (fork / publish / rate / search)
  • Edge-case regressions unlikely to recur
  • Config-constant assertion

Why those wrappers died

Already covered

Passthrough capability tests duplicated community-flow.workers.test.ts — the real journey.

What got consolidated

Fewer workflow cases

  • Handler suites → one journey each
  • Scoring, fork-scan, clipboard, og-image
  • Publish rollback · rate validation

What stayed

High-signal coverage

  • community-flow.workers.test.ts — end-to-end journey
  • community-service.node.test.ts — core service behavior
  • og-image.workers.test.ts — runtime smoke

Enforcement

Keep Tests Tight

  • Cursor Automation · daily 03:00 MDT
  • Reads the repo testing guidelines
  • Edit / combine / delete · open a PR

The prompt thesis

Valuable at the time

Agents create regression tests to verify their work. Useful then. Often should not be kept long-term.

The loop

Ship → over-test → diet

feature lands agents over-test night pass you merge

AI proposes the diet. You keep the judgment.

Homework

One file this week

  • Merge related micro-tests into one workflow
  • Delete one low-signal assertion
  • Optional: write your bar in docs/

Better with Kent

Coverage without clutter

  • Agents write tests for free
  • Maintenance is not free
  • Write the bar · automate the cleanup

Subscribe · comment · get better with me