nickolasjadams / megalavania

Special Order Form SAAS Project
0 stars 0 forks source link

Tests, improvements, registration fix #30

Closed nickolasjadams closed 3 years ago

nickolasjadams commented 3 years ago

We should make sure we run tests before each PR. Especially after database changes. It's easy to break the authentication system.

To run all the tests

php artisan test

To run a specific test

php artisan test --filter NameOfTheTestFile

Feature tests will check a larger set of code. Unit tests target a small specific unit of code. A class or function.

Tests shouldn't commit data changes to a database permanently.

Additional packages have been pulled in with composer so we can run tests more quickly. I haven't tested these parallel tests thoroughly so if something fails and you don't know why then try running sequentially.

Running tests in parallel after your composer install

php artisan test --parallel --processes=4

Note: if you want to make a test yourself, copy a feature/unit test we have. The artisan commands for default feature and unit tests don't work properly with our project. Unit tests imports a TestCase class that was giving me inaccurate results. Neither test was set up to seed the database.