Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fix a small typo in the doc reporter that causes mocha to crash when a test fails.

Jason Leyba3b5818444c06
diff --git a/lib/reporters/doc.js b/lib/reporters/doc.js
index 01f3fdc9..9f5c3f8a 100644
--- a/lib/reporters/doc.js
+++ b/lib/reporters/doc.js
@@ -55,7 +55,7 @@ function Doc(runner) {
runner.on('fail', function(test, err) {
console.log('%s <dt class="error">%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.fn.body));
+ var code = utils.escape(utils.clean(test.body));
console.log('%s <dd class="error"><pre><code>%s</code></pre></dd>', indent(), code);
console.log('%s <dd class="error">%s</dd>', indent(), utils.escape(err));
});