method
test.Expect.closeTo
num: number,
numDigits?: number
): any;
Matches a number close to the provided value. Use it when comparing floating point numbers in object properties or array items. To compare a number directly, use .toBeCloseTo instead.
The optional numDigits argument limits the number of digits to check after the decimal point. For the default value 2, the test criterion is Math.abs(expected - received) < 0.005 (that is, 10 ** -2 / 2).