-
Notifications
You must be signed in to change notification settings - Fork 1
Boolean Assertions
Dylan Parry edited this page Sep 27, 2016
·
7 revisions
expect(item: boolean).toBeTrue(message?: string): this;
Asserts that the tested item
is true
.
Outputs optional message
in case of a failed assertion.
expect(2 + 2 === 4).toBeTrue();
expect(2 + 2 === 5).toBeTrue(); // Assertion Error
expect(item: boolean).toBeFalse(message?: string): this;
Asserts that the tested item
is false
.
Outputs optional message
in case of a failed assertion.
expect(2 + 2 === 5).toBeFalse();
expect(2 + 2 === 4).toBeFalse(); // Assertion Error