This is the first iteration "Making drinks" of the coffee machine project.
The coffee machine can serves 3 type of drinks: tea, coffee, chocolate.
Javascript
Jest
Install CoffeeMachine with npm
cd CoffeMachine
npm install
The 1st iteration of the Coffee Machine project can be found in the drinkmaker.js file.
Testing with Jest
Jest is an automated test-runner for JavaScript.
Let's go!
We are testing the following scenarios
-
Create drink tea wit 2 sugars and 1 stick
-
Create drink Coffee with 1 sugar and 1 stick.
-
Create drink Chocolate with 0 sugar and 0 stick.
-
Create drink with incorrect input
Do the following to run the tests and generate the solution.html file.
$ npm run test
In case you want to check or modify the test, they are in the test/drinkmaker.test.js file.
Open the solution.html file using the Live Server VSCode extension or your browser of choice
Carlos Fung