Skip to content

Commit

Permalink
browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalparadox committed Jun 26, 2012
1 parent 61db4e0 commit a6e2239
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chai.js
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ module.exports = function (chai, _) {
Assertion.addMethod('closeTo', function (expected, delta) {
var obj = flag(this, 'object');
this.assert(
(obj - delta === expected) || (obj + delta === expected)
Math.abs(obj - expected) <= delta
, 'expected #{this} to be close to ' + expected + ' +/- ' + delta
, 'expected #{this} not to be close to ' + expected + ' +/- ' + delta
);
Expand Down Expand Up @@ -3067,8 +3067,9 @@ function formatValue(ctx, value, recurseTimes) {

// Make functions say that they are functions
if (typeof value === 'function') {
var n = value.name ? ': ' + value.name : '';
base = ' [Function' + n + ']';
var name = getName(value);
var nameSuffix = name ? ': ' + name : '';
base = ' [Function' + nameSuffix + ']';
}

// Make RegExps say that they are RegExps
Expand Down

0 comments on commit a6e2239

Please sign in to comment.