--save-dev
option when installing the blueprint-testing
module.npm
on the command-line.npm
to run all test cases in your tests/unit-tests
.tests/unit-tests/bootstrap.js
must load first before running any test cases. This file will load your Blueprint application into memory, and make the application resources available for testing. If you fail to load this file first during your testing exercises, you will get error messages related to the application not being loaded. A common solution to ensure tests/unit-tests/bootstrap.js
loads first is to set tests/unit-tests
as the starting directory for your unit tests.POST /messages
. We can test this route by sending a request a POST
request to /messages
.request
method from blueprint-testing. The request method is a helper method that will return a supertest request object that initiates a http request against the Blueprint application. The request has the option of returning a Promise
that can be returned from the unit testing method to signify asynchronous execution.