From ae4fbca3e19049cd18d676e865c844fbc890e14c Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 26 Nov 2015 11:51:04 +0000 Subject: [PATCH] Fix HTML reporting display to show errors if done is called multiple times, or if an exception is thrown after done is called. --- lib/reporters/html.js | 5 ++++- test/browser/index.html | 1 + test/browser/multiple-done.js | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/browser/multiple-done.js diff --git a/lib/reporters/html.js b/lib/reporters/html.js index 62643ecb3c..277075985d 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -129,7 +129,10 @@ function HTML(runner) { }); runner.on('fail', function(test) { - if (test.type === 'hook') { + // For type = 'test' its possible that the test failed due to multiple + // done() calls. So report the issue here. + if (test.type === 'hook' + || test.type === 'test') { runner.emit('test end', test); } }); diff --git a/test/browser/index.html b/test/browser/index.html index f10732dd4e..9200b977e5 100644 --- a/test/browser/index.html +++ b/test/browser/index.html @@ -14,6 +14,7 @@ +