5 ms·
I like it when you have nice, composable utility functions. Ideally each test contains a short preamble setting up the appropriate context for the test to run.
by abcdaiojjdfoj 3y ago
I like it when you have nice, composable utility functions. Ideally each test contains a short preamble setting up the appropriate context for the test to run. The preamble elucidates what the tests are actually testing. It can also serve as documentation on how to use those functions.
There will probably be some duplication across tests, but if the utility functions are idempotent/composable, they're usually pretty easy to read/understand and equally mechanical to write/update.