Code recipe · Intermediate · 15 min
Snapshot test harness for a pure function
Record current outputs for a set of inputs so a refactor can prove it changed nothing.
- Claude Code
- Cursor
- GitHub Copilot
- Any assistant
- coding
- code
- typescript
Inside this code recipe
- You need to refactor a function with no tests; a snapshot of its behaviour on real inputs is the fastest honest safety net.
- Language
- TypeScript
The full code recipe opens with a membership that covers AI Coding.
Sign in if you already subscribe.
Sign in
