Snippet · Writing & changing code
Set up tests for my stack
One command, one test, running in under ten seconds.
My project is <one sentence>, built with <stack> and hosted on <host>. It has no tests. Set up the test tool people normally use with this stack: - Installation, and the single command that runs everything. - One real test of the thing I'd most hate to break: <describe it>. - How to run a single test on its own. - Whether tests need a database, and how to keep them away from the real one. Tests run on my machine or in CI, never on the live host.
Point tests at a throwaway database from day one. A test suite that can touch production data will eventually do it.