We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The expect.closeTo() API is not supported.
From Jest docs:
expect.closeTo(number, numDigits?) is useful when comparing floating point numbers in object properties or array item.
import { expect, test } from "vitest"; test('compare float in object properties', () => { expect({ title: '0.1 + 0.2', sum: 0.1 + 0.2, }).toEqual({ title: '0.1 + 0.2', sum: expect.closeTo(0.3, 5), }); });
FAIL example.spec.js > compare float in object properties TypeError: expect.closeTo is not a function ❯ example.spec.js:9:17 7| }).toEqual({ 8| title: '0.1 + 0.2', 9| sum: expect.closeTo(0.3, 5), | ^ 10| }); 11| });
Support expect.closeTo() API.
Skip expect.closeTo() API, and direct users to run toBeCloseTo on object property or array item.
toBeCloseTo
No response
The text was updated successfully, but these errors were encountered:
expect.closeTo
Successfully merging a pull request may close this issue.
Clear and concise description of the problem
The expect.closeTo() API is not supported.
From Jest docs:
Suggested solution
Support expect.closeTo() API.
Alternative
Skip expect.closeTo() API, and direct users to run
toBeCloseTo
on object property or array item.Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: