This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Testing Guide
tristan-orourke edited this page Oct 20, 2020
·
5 revisions
This page will help you write and run automated tests, as well as help you decide what to test.
We currently use three testing frameworks:
- PHPUnit, for unit tests and feature tests of php code (the Laravel backend)
- Jest, for unit tests of typescript code (React frontend)
- TestCafe, for browser tests that interact with pages like a user would
PHPUnit uses environment variables from the .env.travis file. Before running tests, you must create the testing database with the command psql -U talentcloud -c "create database testing with owner talentcloud"
.
You can run tests from the project folder with the command vendor/bin/phpunit
. You may find the following options useful:
-
--no-coverage
: skips outputting testing coverage data. Keeps terminal output cleaner when you only want to know which tests failed. -
--filter <Name of file or function>
: runs only tests that match the given string.
Note that if you are using Docker, you will need to run the psql
and phpunit
commands in the postgres and talentcloud containers, respectively.