-
Notifications
You must be signed in to change notification settings - Fork 42
Testing (Backend)
Matt Eden edited this page Apr 14, 2020
·
3 revisions
Unit tests for our Schemas were written using the Mocha framework.
The tests can be run with yarn test in the terminal. In order to successfully run the tests, MongoDB needs to be installed and running separately as a live process.
Postman Collections and Test scripts were used to test our APIs.
The current Doto collection can be accessed here: https://www.getpostman.com/collections/17c539bc0fe909d838cf
This collection can be imported into Postman by using the link above.
- Have Doto web app running.
- Sign in using Google.
- Find
accessToken=in the URL and copy everything after= - When making a request through Postman, navigate to the Headers tab.
- Follow the table below, replacing
YOUR_ACCESS_TOKENwith the access token copied before.
| Key | Value | Description |
|---|---|---|
Authorization |
Bearer YOUR_ACCESS_TOKEN |
We use Mocha to test our database schema for User and Task. It runs well with Node, and supports asynchronous testing.
All our tests are added in the 'test' directory within the backend directory. they have 'test' in the filename so that mocha knows to run these tests.