If interested, please also check previous two articles on setting up the tests:
- https://jczhang.com/2022/08/08/startup-mvp-recipes-9-nest-js-typeorm-postgres-unit-testing-service-onlywith-jest-pg-mem/
- https://jczhang.com/2022/08/09/startup-mvp-recipes-10-nest-js-unit-testing-mocking-service-and-the-universal-mock/
References
- https://medium.com/swlh/jest-and-github-actions-eaf3eaf2427d
- https://github.com/marketplace/actions/run-jest
- https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
Config
On PR open, we will trigger this github action workflow on the cloud and let it run the checks remotely.
Demo

