C4D Practice
← Browse by Chapter
#111Chapter 21 — TDD with Claude Code
Write failing tests for [function] from these cases: [each case with its input and its expected result]. Follow the style of the existing tests. Pass dates in as arguments, use the fakes in [directory] for storage, and do not mock [function] or anything it calls inside its module. Create the function only as a stub that returns a value none of the cases expects, so that each test reaches its assertion, and write no other code. Run the new tests and show me the output: every test must fail on its assertion, with the expected value in the message.
Mastering Claude Code
Mastering Claude Code

These prompts are excerpts from the book. Get the full collection with explanations and use cases.

Get the Book →