Snippet · Writing & changing code
Write the tests first
Make the model prove what "working" means before it builds it.
Feature: <describe it> Before writing the implementation, write the tests. I want: - The happy path. - Two realistic ways a user breaks it. - One edge case I probably haven't thought of. Use <testing framework, or "the simplest thing that runs with no setup">. Show me the tests and stop. I will read them and tell you if they describe the thing I actually asked for.
Tests written before the code are a specification you can run. Tests written after it are a description of whatever got built.