to be infinite

  • <number> [not] to be infinite

Asserts that a number is infinite.

expect(Infinity, 'to be infinite');
expect(-Infinity, 'to be infinite');

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

expect(123, 'to be infinite');
expected 123 to be infinite

This assertion can be negated using the not flag:

expect(123, 'not to be infinite');

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

expect(Infinity, 'not to be infinite');
expected Infinity not to be infinite