unexpected
Advanced tools
Comparing version 2.1.6 to 2.1.7
@@ -130,2 +130,6 @@ (function () { | ||
isError: function (err) { | ||
return typeof err === 'object' && Object.prototype.toString.call(err) === '[object Error]'; | ||
}, | ||
isDate: function (d) { | ||
@@ -326,4 +330,9 @@ if (d instanceof Date) return true; | ||
var isRegExp = utils.isRegExp; | ||
var isError = utils.isError; | ||
var isDate = utils.isDate; | ||
function formatError(err) { | ||
return '[' + Error.prototype.toString.call(err) + ']'; | ||
} | ||
/** | ||
@@ -383,2 +392,6 @@ * Inspects an object. | ||
if (isError(value)) { | ||
return formatError(value); | ||
} | ||
// Look up the keys of the object. | ||
@@ -385,0 +398,0 @@ var visible_keys = getKeys(value); |
{ | ||
"name": "unexpected", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"jshint": "*", | ||
"mocha": "=1.12.0", | ||
"mocha": "=1.17.1", | ||
"phantomjs": "=1.9.1-0", | ||
@@ -26,0 +26,0 @@ "mocha-phantomjs": "=3.1.0", |
@@ -15,4 +15,9 @@ /*global namespace*/ | ||
var isRegExp = utils.isRegExp; | ||
var isError = utils.isError; | ||
var isDate = utils.isDate; | ||
function formatError(err) { | ||
return '[' + Error.prototype.toString.call(err) + ']'; | ||
} | ||
/** | ||
@@ -72,2 +77,6 @@ * Inspects an object. | ||
if (isError(value)) { | ||
return formatError(value); | ||
} | ||
// Look up the keys of the object. | ||
@@ -74,0 +83,0 @@ var visible_keys = getKeys(value); |
@@ -61,2 +61,6 @@ /*global namespace*/ | ||
isError: function (err) { | ||
return typeof err === 'object' && Object.prototype.toString.call(err) === '[object Error]'; | ||
}, | ||
isDate: function (d) { | ||
@@ -63,0 +67,0 @@ if (d instanceof Date) return true; |
@@ -56,2 +56,8 @@ /*global describe, it, expect*/ | ||
it('formats Error instances correctly when an assertion fails', function () { | ||
expect(function () { | ||
expect(new Error('error message'), 'to be a number'); | ||
}, 'to throw', "expected [Error: error message] to be a 'number'"); | ||
}); | ||
it('throws with a stack trace that has the calling function as the top frame when the assertion fails (if the environment supports it)', function () { | ||
@@ -58,0 +64,0 @@ if (Error.captureStackTrace || 'stack' in new Error()) { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257410
5049