-
Notifications
You must be signed in to change notification settings - Fork 42
Testing (Backend)
Lucy Chen edited this page Mar 20, 2020
·
3 revisions
Unit tests for our Schemas were written using the Mocha framework.
The tests can be run with npm test
in the terminal.
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_TOKEN
with 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.