to be empty

  • <string> [not] to be empty

Asserts that the string is empty.

Aliases: to be the empty string, to be an empty string

expect('', 'to be empty');

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

expect('Hello world', 'to be empty');
expected 'Hello world' to be empty

This assertion can be negated using the not flag:

expect('Hello world', 'not to be empty');

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

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