Skip to content
Browse files

browser build

  • Loading branch information...
1 parent 61db4e0 commit a6e22390c84e9b4664e950df56eebd1ac6cd3a75 @logicalparadox logicalparadox committed Jun 26, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 chai.js
View
7 chai.js
@@ -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
);
@@ -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

0 comments on commit a6e2239

Please sign in to comment.
Something went wrong with that request. Please try again.