Describe Expected Behavior
When asking for tests, describe what should pass and what should fail. Give examples of inputs and expected outputs. Claude Code writes better tests when it knows exactly what 'correct' looks like.
Where you'll practice this
2 Promptles scenarios teach this principle directly. Each one drops you into a real engineering ticket and asks you to write the prompt you'd send to Claude Code.
Test the Validator
You have a function `validateEmail` in `validation.js` that checks if a string is a valid email address. It returns `true` for valid emails and `false` for invalid ones. You want Claude Code to write unit tests for it using Jest.
The Test Suite
You're writing Postman tests for `GET /api/users/:id` on your internal user service. A successful response is `200 OK` with a JSON body containing `id` (UUID string), `email` (string, RFC 5322), `displayName` (non-empty string), `createdAt` (ISO 8601 timestamp), and `role` (one…