Skip to content

armgit / mocha

Public Imported from GitHub
0

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

fixed js error that occurred when attempting to "view source" on a pending test

vlad633bb9e837d3
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index 1d937928..a1b1ce3b 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -109,9 +109,9 @@ function HTML(runner) {
// toggle code
el.find('h2').toggle(function(){
- pre.slideDown('fast');
+ pre && pre.slideDown('fast');
}, function(){
- pre.slideUp('fast');
+ pre && pre.slideUp('fast');
});
// code
diff --git a/test/browser/style.css b/test/browser/style.css
index f136f796..1ea822f6 100644
--- a/test/browser/style.css
+++ b/test/browser/style.css
@@ -40,6 +40,10 @@ body {
color: #888;
}
+#mocha .test.pending:hover h2::after{
+ content: '(pending)';
+}
+
#mocha .test.pass::before {
content: '✓';
font-size: 12px;