Skip to content

armgit / mocha

Public Imported from GitHub
0

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

click toggle

Tj Holowaychuk66661306d69b
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index 8c7215aa..c413f4b5 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -75,6 +75,13 @@ function HTML(runner) {
el.append(err);
}
+ // toggle code
+ el.find('h2').toggle(function(){
+ pre.slideDown('fast');
+ }, function(){
+ pre.slideUp('fast');
+ });
+
// code
var pre = $('<pre><code>' + clean(test.fn.toString()) + '</code></pre>');
pre.appendTo(el);
diff --git a/mocha.js b/mocha.js
index 8f26a661..f46a1c4a 100644
--- a/mocha.js
+++ b/mocha.js
@@ -816,6 +816,13 @@ function HTML(runner) {
el.append(err);
}
+ // toggle code
+ el.find('h2').toggle(function(){
+ pre.slideDown('fast');
+ }, function(){
+ pre.slideUp('fast');
+ });
+
// code
var pre = $('<pre><code>' + clean(test.fn.toString()) + '</code></pre>');
pre.appendTo(el);
diff --git a/test/browser/style.css b/test/browser/style.css
index 162a43af..861e9dbc 100644
--- a/test/browser/style.css
+++ b/test/browser/style.css
@@ -20,6 +20,7 @@ h1 {
h2 {
font-size: 12px;
font-weight: normal;
+ cursor: pointer;
}
.suite {
@@ -71,10 +72,6 @@ h2 {
-webkit-box-shadow: 0 1px 3px #eee;
}
-.test:hover pre {
- display: inline-block;
-}
-
#stats {
position: fixed;
top: 15px;