@@ -1,5 +1,13 @@
|
||||
getJasmineRequireObj().toBeCloseTo = function() {
|
||||
|
||||
/**
|
||||
* {@link expect} the actual value to be within a specified precision of the expected value.
|
||||
* @function
|
||||
* @name matchers#toBeCloseTo
|
||||
* @param {Object} expected - The expected value to compare against.
|
||||
* @param {Number} [precision=2] - The number of decimal points to check.
|
||||
* @example
|
||||
* expect(number).toBeCloseTo(42.2, 3);
|
||||
*/
|
||||
function toBeCloseTo() {
|
||||
return {
|
||||
compare: function(actual, expected, precision) {
|
||||
|
||||
Reference in New Issue
Block a user