From 3e2194b6cb3a4122af70b56bc08018435f681ebd Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 17 Feb 2016 10:43:49 +0000 Subject: [PATCH] Check for `toString` method --- lib/reporters/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reporters/base.js b/lib/reporters/base.js index 626e0aaa18..99cee4afc1 100644 --- a/lib/reporters/base.js +++ b/lib/reporters/base.js @@ -170,7 +170,7 @@ exports.list = function(failures) { var msg; var err = test.err; var message; - if (err.message && typeof err.message === 'string') { + if (err.message && typeof err.message.toString === 'function') { message = err.message; } else if (typeof err.inspect === 'function') { message = err.inspect() + '';