End-to-End Testing the BookSwap Web Application
We have made a lot of progress toward our goal of learning how to use TDD for implementing and testing Go code. So far, we have covered a wide variety of techniques for implementing unit and integration tests. Unit tests verify that each component works as intended, while integration tests extend their scope to cover the seams and interactions between different units. Moreover, we have learned how to apply these techniques to a wide variety of examples, including the BookSwap
web application introduced in previous chapters.
These tests give us a fast feedback loop for code changes, as they don’t require the entirety of the application to be started up and made available before the test suite is run. As discussed in Chapter 5, Performing Integration Testing, we learned how to make use of the httptest
and ginkgo
libraries to easily write and run integration tests for web applications. We also learned how to make use of behavior...