Skip to content

Commit

Permalink
docs: Fix argument name in expect.md (vitest-dev#6254)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-we authored Aug 1, 2024
1 parent c997937 commit a7be50d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/expect.md
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ test('"id" is a number', () => {

`expect.closeTo` is useful when comparing floating point numbers in object properties or array item. If you need to compare a number, please 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)`.
The optional `precision` 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)`.

For example, this test passes with a precision of 5 digits:

Expand Down

0 comments on commit a7be50d

Please sign in to comment.