bool

Bool asserter.

Assert that the type of actual value is a boolean (using .isBool() assertion). The bool() asserter provides adapted assertions for works on a boolean.

See also the spec of "bool" asserter for more examples.


See also

Example

test.bool(actual);

Methods

isTrue()


Assert that the actual value is true.

Returns
Type Description
Object

The current instance

Example
test.bool(true).isTrue();

See also

isNotTrue()


Assert that the actual value is not true.

Returns
Type Description
Object

The current instance

Example
test
  .bool(false)
    .isNotTrue()

  .bool(1)
    .isNotTrue()

  .bool('1')
    .isNotTrue()

  .bool('true')
    .isNotTrue()
;

See also

isFalse()


Assert that the actual value is false.

Returns
Type Description
Object

The current instance

Example
test.bool(false).isFalse();

See also

isNotFalse()


Assert that the actual value is not false.

Returns
Type Description
Object

The current instance

Example
test
  .bool(true)
    .isNotFalse()

  .bool(0)
    .isNotFalse()

  .bool('0')
    .isNotFalse()

  .bool('false')
    .isNotFalse()

  .bool(null)
    .isNotFalse()

  .bool(undefined)
    .isNotFalse()
;

See also