Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

#1190: add error message to failed test with json-stream reporter

Christopher Hiller6ddcde35a3ac
diff --git a/lib/reporters/json-stream.js b/lib/reporters/json-stream.js
index a591cec6..f7c05a89 100644
--- a/lib/reporters/json-stream.js
+++ b/lib/reporters/json-stream.js
@@ -34,7 +34,9 @@ function List(runner) {
});
runner.on('fail', function(test, err){
- console.log(JSON.stringify(['fail', clean(test)]));
+ test = clean(test);
+ test.err = err.message;
+ console.log(JSON.stringify(['fail', test]));
});
runner.on('end', function(){