We are going to put our testing skills to the test(pun intended) by writing some tests on an existing piece of code.
Within testing_homework.js, we have a calculator
object, along with some starter testing code, so far we have one test already, which tests the calculator.add()
function, let's finish the rest of the tests!
- Write an it() test for every method within
calculator
- If there are any bugs( there are :) ) fix them on the calculator object.
- Make sure all of your tests that you write are correct.
- Make all of your tests pass.
BONUS:
Fill out the calculator.random
function to return a random integer between 1-10(including 10).
Write a test for this to test that it's always returning a number between 1-10.