December 2015
Intermediate to advanced
240 pages
4h 57m
English
Assertions in Jasmine are named as an expectation. An expectation can either be true or false. Every expectation takes an actual value as only argument. An expectation is then chained with a matcher, which takes the expected value as an argument.
expect(true).toBe(true);
Here, expect is an expectation and toBe is a matcher. To evaluate negative assertions, expect() is chained with a not before calling a matcher. Matchers are used for Boolean comparison and validation of an expected value. You will learn more about matchers in the next subsection. See the following code:
expect(false).not.toBe(true);
Read now
Unlock full access