Adding expectations and matchers to the test
expect function, which takes a value called
actual. It is further chained with the matcher function(s), which takes the
expected value. Each matcher implements a Boolean expression depending on the actual and expected value. It is responsible for reporting to Jasmine whether the expectation is true or false. Jasmine passes or fails the spec on the basis of the Boolean value returned by the matcher. In this recipe, you will learn how assertions are applied using the
toBe matcher. You will also learn how negative ...