Why I write integration tests first: 1 I don't have to keep manually running...


Why I write integration tests first:

1 I don't have to keep manually running the app to see my code work. Integration tests automate the browser.

2 Integration tests speed my feedback loop. This more than pays for the time I spend writing them.

3 It assures I write the test...
4 Each time I add a new feature or handle an edge case, I add another test. This assures the test coverage is comprehensive.

5 Testing encourages me to consider edge cases.

6 Writing the test first informs my design. It assures I'm writing the feature in a testable manner.
There are many ways to write integration tests.

My preferred stack:
@cypress_io
@testinglib Cypress query enhancements
json-server for mock APIs

Good news: It's all free. 😀

View original on X