to be finite

  • <number> [not] to be finite

Asserts that a number is finite.

expect(123, 'to be finite');

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

expect(Infinity, 'to be finite');
expected Infinity to be finite

This assertion can be negated using the not flag:

expect(Infinity, 'not to be finite');
expect(-Infinity, 'not to be finite');

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

expect(123, 'not to be finite');
expected 123 not to be finite