Compares floating point numbers for approximate equality. Use this method instead of expect(value).toBe(expected) when comparing floating point numbers.
Usage
expect(0.1 + 0.2).not.toBe(0.3);expect(0.1 + 0.2).toBeCloseTo(0.3, 5); Copy
expect(0.1 + 0.2).not.toBe(0.3);expect(0.1 + 0.2).toBeCloseTo(0.3, 5);
Internal options that provide extra context for the matcher.
Received value.
Expected value.
The number of decimal digits after the decimal point that must be equal.
Compares floating point numbers for approximate equality. Use this method instead of expect(value).toBe(expected) when comparing floating point numbers.
Usage