Skip to content

armgit / mocha

Public Imported from GitHub
0

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

build

TJ Holowaychukb9eddbc7b005
diff --git a/mocha.js b/mocha.js
index a776c03d..91a414e1 100644
--- a/mocha.js
+++ b/mocha.js
@@ -2026,11 +2026,12 @@ function HTML(runner, root) {
// test
if ('passed' == test.state) {
- var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="?grep=%e" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, test.fullTitle());
+ var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="?grep=%e" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, encodeURIComponent(test.fullTitle()));
+ console.log(el.querySelector('a'));
} else if (test.pending) {
var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
} else {
- var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">‣</a></h2></li>', test.title, test.fullTitle());
+ var el = fragment('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">‣</a></h2></li>', test.title, encodeURIComponent(test.fullTitle()));
var str = test.err.stack || test.err.toString();
// FF / Opera do not add the message
@@ -2067,9 +2068,7 @@ function HTML(runner, root) {
}
// Don't call .appendChild if #mocha-report was already .shift()'ed off the stack.
- if (stack[0]) {
- stack[0].appendChild(el);
- }
+ if (stack[0]) stack[0].appendChild(el);
});
}