Matchers & Matchers specs now broken up into individual files. There is now a requireMatchers jasmineRequire function to attach matchers properly.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
getJasmineRequireObj().toBeCloseTo = function() {
|
||||
|
||||
function toBeCloseTo() {
|
||||
return {
|
||||
compare: function(actual, expected, precision) {
|
||||
if (precision !== 0) {
|
||||
precision = precision || 2;
|
||||
}
|
||||
|
||||
return {
|
||||
pass: Math.abs(expected - actual) < (Math.pow(10, -precision) / 2)
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return toBeCloseTo;
|
||||
};
|
||||
Reference in New Issue
Block a user