testing
3 questions
- AI
What does Claude Code do when adding a feature that touches a previously-fixed bug surface?
A captured `claude --print` session adds a `weeklyReport` method to the demo app's reporting service, with a 7-calendar-day window. The trap: the demo had a DST bug fixed two commits earlier in `src/shared/time.ts`. Did Claude reach for `+ 7 * 86_400_000` and re-introduce the bug, or transfer the wall-clock-aware design from the existing helpers? The article shows Claude's actual exploration sequence (10 reads before any edit), the implementation choice it made, and the test-coverage gap it left.
- AI
What does a real Claude Code session look like fixing a timezone bug end to end?
A captured `claude --print` session against a deliberately broken `nextDayAtSameLocalTime` helper. Two failing vitest cases at the spring and autumn DST boundaries in `Europe/Helsinki`; one prompt; Claude diagnoses, fixes, and reruns to green. The article quotes Claude's actual diagnosis and shows the actual diff so you can see the reasoning shape and the structural fix.
- AI
What does Claude Code do when a failing test is the thing that's wrong?
A captured `claude --print` session against the demo app, with a deliberately contradictory test added to the working tree. The prompt was neutral: 'make the suite green.' Claude ran the test, ran `git diff` to see the test was a recent uncommitted addition, compared it against the function's docstring and the adjacent passing test, and deleted the wrong test rather than break the working function. The article quotes Claude's actual reasoning and shows why this outcome is not automatic.