In this practice, you will be refactoring code to follow the Single Responsibility Principle.
Clone the practice from the starter.
Run npm install
to install all dependencies.
Take a look at the bakeAndSellPies
function in the practice.js file. This
function passes all the specs if you run npm test
, but the function is doing
too much. Refactor the function into multiple helper functions to follow the
Single-Responsibility Principle.
When you are sure that you have successfully refactored the code, run npm test
to see if the functions still return the correct information by making sure all
the test specs still pass.