Skip to content

Glossary: Testing Web Apps

toBeCloseTo

A Vitest matcher that allows a tiny difference, for comparing decimals such as 0.1 + 0.2 with 0.3. Keeping money in whole cents avoids the need for it.

Where the book teaches it

Related terms

toMatchObjectCents (money as whole numbers)