Skip to content

Commit

Permalink
Refactor literal play-icon hex code to a var
Browse files Browse the repository at this point in the history
  • Loading branch information
dasilvacontin committed Apr 24, 2017
1 parent 1d3c5bc commit 861e968
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/reporters/html.js
Expand Up @@ -41,6 +41,8 @@ var statsTemplate = '<ul id="mocha-stats">' +
'<li class="duration">duration: <em>0</em>s</li>' +
'</ul>';

var playIcon = '&#x2023;';

/**
* Initialize a new `HTML` reporter.
*
Expand Down Expand Up @@ -136,15 +138,15 @@ 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">&#x2023;</a></h2></li>';
'<a href="%s" class="replay">' + playIcon + '</a></h2></li>';
var el = fragment(markup, test.speed, test.title, test.duration, url);
self.addCodeToggle(el, test.body);
appendToStack(el);
updateStats();
});

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

0 comments on commit 861e968

Please sign in to comment.