to be falsy

  • <any> [not] to be falsy <string>
  • <any> [not] to be falsy

Asserts that the value is falsy.

expect(0, 'to be falsy');
expect(false, 'to be falsy');
expect('', 'to be falsy');
expect(undefined, 'to be falsy');
expect(null, 'to be falsy');

In case of a failing expectation you get the following output:

expect({}, 'to be falsy');
expected {} to be falsy

This assertion can be negated using the not flag:

expect(1, 'not to be falsy');
expect(true, 'not to be falsy');
expect({}, 'not to be falsy');
expect('foo', 'not to be falsy');
expect(/foo/, 'not to be falsy');

In case of a failing expectation you get the following output:

expect('', 'not to be falsy');
expected '' not to be falsy