Add unit tests to a LoopBack API project
In this lesson we will learn how to add tests to the project to make sure our API behaves as we expect.
chai as devDependencies we will add
test:watch scripts to our
package.json. We will create a different datasource what we will use when running the tests by copying
datasources.test.json and prefixing our
test command with
We will verify that our tests run against an empty datasource. We’ll also add various tests to verify that our remote method and validation on the Product model behave as expected.