Unit testing an API
Now that we've got a basic understanding about using Mocha for testing, we're going to create some unit tests for our API endpoints.
What is a unit test?
Before we begin, let's discuss an important concept, which is the idea of a "unit" in unit testing.
So, a unit, is a small, testable part of our application. Typically, this will be a function, like it was in the demo test that we wrote.
Click to load comments...