In this lab, the code for a payments processor has been implemented, and your task is to write tests for each function:
paymentService.js
main.js
queueService.js
(you can do it in this order if you want to start with simpler tests before moving to harder tests)
IMPORTANT: not all functions will require mocking! If the function has a dependency on something from another file/library, mock that dependency. Otherwise, just test it like how you've been unit-testing functions
- Fork and clone repo
- Install dependencies:
npm install
- cd into project directory
- Run tests:
npm run test:watch
- You can also check your test coverage:
npm run test:coverage