Exploring Godog
In this chapter, we have made quite a few changes that have extended the scope and complexity of the BookSwap
application. Now that we can easily start and tear down the application using Docker containers, it is time to turn our attention to writing E2E tests for our application.
In Chapter 5, Performing Integration Testing, we looked at how to write BDD-style tests. This style of testing allows us to write human-readable test scenarios and use a Given-When-Then structure. These readable tests can serve as documentation for our projects, allowing us to involve multiple stakeholders and write tests that truly cover the functionality of our applications.
We also explored the ginkgo
testing library, which allowed us to write tests using this style. Godog (https://github.com/cucumber/godog) is another testing library that we will be exploring to write BDD-style tests. ginkgo
allows us to add BDD-style assertions to our unit tests, but Godog provides extra code generation...