Merge branch 'vanduynslagerp-fix-tobecloseto'

- Fixes #1382

Signed-off-by: Alpha Chen <achen@pivotal.io>
This commit is contained in:
Alpha Chen
2017-06-26 10:19:57 -07:00
3 changed files with 30 additions and 2 deletions

View File

@@ -2794,8 +2794,9 @@ getJasmineRequireObj().toBeCloseTo = function() {
);
}
var pow = Math.pow(10, precision + 1);
return {
pass: Math.abs(expected - actual) < (Math.pow(10, -precision) / 2)
pass: +(Math.round(Math.abs(expected - actual) * pow) / pow).toFixed(precision + 1) <= (Math.pow(10, -precision) / 2)
};
}
};