From 808889b4e5198f7abecf0829f22f03ecc23706dd Mon Sep 17 00:00:00 2001 From: macmenot Date: Tue, 8 Jul 2014 19:50:49 +0100 Subject: [PATCH] Always display better AssertionError msg Fix `betterErrors` to display the useful Assertion message even when actual/expected are 0 or undefined. Fixes #220 --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 5c72990db..f58e1ceaa 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -196,7 +196,7 @@ exports.betterErrors = function (assertion) { return assertion; } var e = assertion.error; - if (e.actual && e.expected) { + if (e.operator) { var actual = util.inspect(e.actual, false, 10).replace(/\n$/, ''); var expected = util.inspect(e.expected, false, 10).replace(/\n$/, ''); var multiline = (