Skip to content

Commit

Permalink
Use Object.is for Number equality
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Feb 24, 2019
1 parent 997add9 commit 84de9da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/expect/src/jasmineUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function eq(
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
// other numeric values.
return a != +a ? b != +b : Number(a) === 0 && Number(b) === 0 ? 1 / a == 1 / b : a == +b;
return Object.is(Number(a), Number(b));
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
Expand Down

0 comments on commit 84de9da

Please sign in to comment.