August 2017
Beginner
374 pages
10h 41m
English
Jest also offers various matchers for comparing numbers:
Of course, you can also use toBe and toEqual for numbers (as we did in the first example).
For floating point numbers, there is a special matcher: toBeCloseTo. This matcher is useful when dealing with rounding errors in floating point calculations; for example:
testRead now
Unlock full access