Integration test example
We will look at a public API, such as CircleCI, and write an integration test that hits the API endpoint and verifies that the status code and the body of the request are what we would expect. This would typically be a local API that you are working on and want verification of correct behavior but, as an example, we will hit the CircleCI for illustration purposes only. We will create a new repository in GitHub using our packtci user and call it integration-test-example (https://github.com/packtci/integration-test-example). We will use several libraries including supertest (https://github.com/visionmedia/supertest), a Node.js library, baloo (https://github.com/h2non/baloo), a Golang library to hit API endpoints, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access