Fix toBeCloseTo matcher for Node.js 12 and Chrome 74

This commit is contained in:
Paul van Brenk
2019-05-19 12:46:32 -04:00
parent e04d3d8a62
commit 69a7449e50
2 changed files with 15 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ getJasmineRequireObj().toBeCloseTo = function() {
var maxDelta = Math.pow(10, -precision) / 2;
return {
pass: Math.round(delta * pow) / pow <= maxDelta
pass: Math.round(delta * pow) <= maxDelta * pow
};
}
};