A Pair Programming Exercise by OKC WebDevs
Explore the before
directory, and run the code there:
node before/index.js
Now see how you can refactor it. The purpose of the main function is to accept a list of positive numbers, sum them, and increase them by a tax rate of 8% for a final price.
When you're ready and want to check how we refactored things, check out the
after
directory.
To run the code there:
node after/index.js
There is a simple Jest test set up for the refactored code. To set up the test environment:
cd after
npm install
To run the test suite:
npm run test