Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Testing

Michiel edited this page Mar 6, 2023 · 17 revisions

Frontend

Testing with Next.JS: https://nextjs.org/docs/testing

Framework TBA

Backend

Backend unit/integration test are done with the unittest framework. Because we work with docker, the tests needs to run in the docker. This can be done with following commands.

  1. Run all tests: docker exec -it DrTrottoir-be python manage.py test

  2. Run one test file: docker exec -it DrTrottoir-be python manage.py test drtrottoir.tests.<TESTFILE>

  3. Run one test class: docker exec -it DrTrottoir-be python manage.py test drtrottoir.tests.<TESTFILE>:<TESTCLASS>

  4. Run a single test: docker exec -it DrTrottoir-be python manage.py test drtrottoir.tests.<TESTFILE>:<TESTCLASS>.<TESTMETHOD>

When all tests succeed, the coverage of the tests will also be showen in stdout. The coverage will be calculated for all the files in the Dr-Trottoir-2/drtrottoir directory. This can be edited in manage.pyand it is also possible to omit some files there.

Documentation about unittest:

Some other useful tools:

  • Coverage testing met coverage.py, Link
  • Selenium, automate testing in a real browser.
Clone this wiki locally