๐ŸŒŒtoBeFinite

A test that should be defined in euclidean space.

This comparison is used to detect if float values are finite. The following values are not finite in JavaScript or AssemblyScript.

  • Infinity

  • -Infinity

  • NaN

The following assertions are true.

expect(1.0).toBeFinite();
expect(Infinity).not.toBeFinite();
expect(NaN).not.toBeFinite();

As long as the number values are always f32 or f64 (or number in JavaScript or AssemblyScript,) toBeFinite is a safe assertion to use portably with jest.

If this method is called without a float without a float value type, it will result in a compile time error.

This method is safe to use portably with jest.

Last updated