This script will run both backend and frontend tests
In gitbash:
./run-tests.sh
In powershell:
.\run-tests.sh
Note: will need to press [Ctrl]+[C] after npm tests finish
The frontend ReactJS application currently has a test of unit tests using Enzyme.
To run these tests, you'll need to enter the frontend Docker container.
In powershell:
docker exec -it project-thundercat_frontend_1 /bin/bash
npm run test
The backend Django application has a set of tests for it's views and uses Postman to manage API tests.
To run the unit tests, you'll need to enter the backend Docker container.
In powershell:
docker exec -it project-thundercat_backend_1 /bin/bash
./manage.py test tests
To run Postman tests, you'll need to launch Postman desktop app and setup your environment.
-
Import ThunderCAT local environment:
Then select the following file: \project-thundercat\backend\tests\postman\environments\local\ThunderCAT.local.postman_environment.json.
You can then put the name of your choice for this new imported environment (e.g. "ThunderCAT - Local").
-
Make sure that you new environment is selected:
-
Import ThunderCAT collection:
Then select the following file: \project-thundercat\backend\tests\postman\ThunderCAT.postman_collection.json.
You have now your new ThunderCAT collection:
-
You can either run individual tests or run the whole collection:
Individual test:
Whole collection:
Note that if you run the whole collection, you may need to delete some data, since the tests are creating new accounts and you also may need to add authorization for protected APIs.