🌌
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.
1
expect(1.0).toBeFinite();
2
expect(Infinity).not.toBeFinite();
3
expect(NaN).not.toBeFinite();
Copied!
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 modified 1yr ago
Copy link