Implementation of First Jasmine Specfication
Expectations are built with the function expect
which takes a value, called the actual. It is chained with a Matcher function, which takes the expected value.
Each matcher implements a boolean comparison between the actual value and the expected value. It is responsible for reporting to Jasmine if the expectation is true or false. Jasmine will then pass or fail the spec.
If we change the method logic for example:
What we will see in the browser after running our npm test
will be:
After fixing the bug in our code we will finally see the following lines, in the subtraction
method we will modifying the '-' for the '*' we will see:
Last updated