Commit 279b6e2e authored by Florent Chehab's avatar Florent Chehab

Added a bit of documentation regarding frontend testing

Also added shortcut in the Makefile
parent f22eb1d0
Pipeline #35529 passed with stages
in 4 minutes and 23 seconds
......@@ -15,6 +15,9 @@ reformat_backend:
test_backend:
docker-compose exec backend sh -c "cd backend && pytest base_app/ backend_app/"
test_frontend:
docker-compose exec frontend sh -c "cd frontend && npm run test"
check_backend:
docker-compose exec backend sh -c "cd backend && ./manage.py check"
......
......@@ -7,5 +7,6 @@
* [Architecture](architecture.md)
* [Tags](tags.md)
* [API](API.md)
* [Tests](tests.md)
* [About this documentation](this_doc.md)
* [Contributions](contributions.md)
Tests
======
*Rex-DRI* comes in with several *tests* that you can perform locally using the commands `make test_backend` and `make test_frontend` once the project is up and running (`make up`).
## Backend testing
### General words
Testing the backend is handled with a combination of `pytest` and `Django` (and `pytest-django` package).
The tests are found in the `backend_app/tests/` folder and they mostly test the custom behaviors that are implemented in the app such as moderation and versioning.
Also, there are tests regarding some custom validation.
Finally, the initial and example loading data scripts are tested.
### Documentation
Some usefull links to get inspired:
- [General information about testing in Django](https://docs.djangoproject.com/fr/2.1/topics/testing/overview/)
- [`pytest` documentation](https://docs.pytest.org/en/latest/)
- [`pytest-django` documentation](https://pytest-django.readthedocs.io/en/latest/)
## Frontend testing
### General words
Testing the frontend is done with `jest`.
### Documentation
- [`jest` documentation](https://jestjs.io/docs/en/getting-started)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment