A current set of functions correctly filters and calculates the total for all products between a range of prices. You need to add errors to some of the functions and handle those errors in others.
-
Fork and clone this repository.
-
Navigate to the cloned repository's directory on your command line. Then, run the following command:
npm install
This will install the libraries needed to run the tests.
-
Open up the repository in VSCode. Follow the instructions below to complete the Lab.
Update the functions in index.js
so they throw the errors as prescribed. Then, for the last function, handle those errors as described.
To run the tests, you can run the following command from the command line. You will need to be in the root directory of your repository.
npm test
This will run the test output once.
If you'd like, you can have the tests run constantly. This means that each time you save your file, your tests will re-run. To do so, you can run the following:
npm run watch
Follow the on-screen prompts to exit out of the constant runner.
If you want to manually test out your file, you can do so by running the following command.
node index.js
The output will be printed to your terminal.