Skip to content

Commit 861e968

Browse files
committed
Refactor literal play-icon hex code to a var
1 parent 1d3c5bc commit 861e968

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/reporters/html.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ var statsTemplate = '<ul id="mocha-stats">' +
4141
'<li class="duration">duration: <em>0</em>s</li>' +
4242
'</ul>';
4343

44+
var playIcon = '&#x2023;';
45+
4446
/**
4547
* Initialize a new `HTML` reporter.
4648
*
@@ -136,15 +138,15 @@ function HTML (runner) {
136138
runner.on('pass', function (test) {
137139
var url = self.testURL(test);
138140
var markup = '<li class="test pass %e"><h2>%e<span class="duration">%ems</span> ' +
139-
'<a href="%s" class="replay">&#x2023;</a></h2></li>';
141+
'<a href="%s" class="replay">' + playIcon + '</a></h2></li>';
140142
var el = fragment(markup, test.speed, test.title, test.duration, url);
141143
self.addCodeToggle(el, test.body);
142144
appendToStack(el);
143145
updateStats();
144146
});
145147

146148
runner.on('fail', function (test) {
147-
var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">&#x2023;</a></h2></li>',
149+
var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">' + playIcon + '</a></h2></li>',
148150
test.title, self.testURL(test));
149151
var stackString; // Note: Includes leading newline
150152
var message = test.err.toString();

0 commit comments

Comments
 (0)