dcsil / dream-team

Team repository for Dream Team
https://dreamtune-cdf8a.web.app/auth/login
0 stars 1 forks source link

Create some initial tests on the homepage react app #133

Closed RyanMarten closed 4 years ago

RyanMarten commented 4 years ago

As an example of how to write tests for the rest of the app.

I will be using jest to do this

RyanMarten commented 4 years ago

Switching back to using create react app scripts and their jest setup because it works natively with React, whereas my custom setup requires plain javascript.

So I will have to find a way for it to generate a coverage report instead of configuring the jest package. There is some documentation here: https://create-react-app.dev/docs/running-tests/#continuous-integration

This suggests npm test -- --coverage

RyanMarten commented 4 years ago

Using yarn now instead because npm is giving me problems and people suggest yarn

RyanMarten commented 4 years ago

npm run test -- --coverage --watchAll=false This now the way to run a single test over the files in the repo and get a coverage report in /app/coverage/coverage-final.json

I'll update this in the github actions file