Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Replaced embedded unicode characters in html reporter to their hex encoded equivalents.

rotemdan4de2df445819
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index 9b9817c5..3e755d2d 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -136,7 +136,7 @@ function HTML (runner) {
runner.on('pass', function (test) {
var url = self.testURL(test);
var markup = '<li class="test pass %e"><h2>%e<span class="duration">%ems</span> ' +
- '<a href="%s" class="replay">‣</a></h2></li>';
+ '<a href="%s" class="replay">&#x2023;</a></h2></li>';
var el = fragment(markup, test.speed, test.title, test.duration, url);
self.addCodeToggle(el, test.body);
appendToStack(el);
@@ -144,7 +144,7 @@ function HTML (runner) {
});
runner.on('fail', function (test) {
- var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>',
+ var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">&#x2023;</a></h2></li>',
test.title, self.testURL(test));
var stackString; // Note: Includes leading newline
var message = test.err.toString();
diff --git a/mocha.js b/mocha.js
index e316e555..390f5907 100644
--- a/mocha.js
+++ b/mocha.js
@@ -2705,7 +2705,7 @@ function HTML (runner) {
runner.on('pass', function (test) {
var url = self.testURL(test);
var markup = '<li class="test pass %e"><h2>%e<span class="duration">%ems</span> ' +
- '<a href="%s" class="replay">‣</a></h2></li>';
+ '<a href="%s" class="replay">&#x2023;</a></h2></li>';
var el = fragment(markup, test.speed, test.title, test.duration, url);
self.addCodeToggle(el, test.body);
appendToStack(el);
@@ -2713,7 +2713,7 @@ function HTML (runner) {
});
runner.on('fail', function (test) {
- var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>',
+ var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">&#x2023;</a></h2></li>',
test.title, self.testURL(test));
var stackString; // Note: Includes leading newline
var message = test.err.toString();