Open
Description
I was thinking of adding a section somewhere with several tips on writing testable code:
- Extract requests into services to simplify mocking.
- Extract complex methods and test them in isolation.
- Do not test implementation details (with examples).
- Build small things to have simpler test scenarios.
- Write tests before writing production code (the ultimate technique to write testable code 😆).
Also, we could point to some smells:
- Large "setup/arrange" blocks on each test.
- Breaking tests on a refactor (from my POV this is critical but I'm not 100% sure it would fit in this section).
Sounds cool? More ideas?
disclaimer: There's a lot of content on the internet about these topics. I think this section should be focused on Vue stuff with Vue examples, and then maybe links to well-established content.