cross20 / mini-warehouse

A home inventory solution.
https://mini-warehouse.vercel.app
0 stars 0 forks source link

Set up unit testing #18

Closed cross20 closed 1 year ago

cross20 commented 1 year ago

Unit testing should be set up so to ensure the project works before it is deployed. To set it up, see this guide on unit testing with Jest/React/Next.

cross20 commented 1 year ago

Also, use the React guide for running tests to set up unit testing.

cross20 commented 1 year ago

GitHub Actions need to be set up to ensure tests pass before merging into the main branch.

cross20 commented 1 year ago

Creating new branch 18-set-up-unit-testing-fix-infinite-test to address an issue where unit tests run indefinitely in GitHub actions. The issue occurs because the --watch flag is being used when running tests, which requests user input.

cross20 commented 1 year ago

To prevent infinite tests, but also allow local tests to continue running in watch mode, the GitHub actions script directly runs npx jest rather than running the test script defined in the package.json file.