Skip to content

Commit

Permalink
Make HTML reporter failure/passed links preventDefault to avoid SPA's…
Browse files Browse the repository at this point in the history
… hash navigation (#2119)
  • Loading branch information
theearthman81 authored and dasilvacontin committed May 25, 2016
1 parent 6d24063 commit 9e93efc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/reporters/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ function HTML(runner) {
}

// pass toggle
on(passesLink, 'click', function() {
on(passesLink, 'click', function(evt) {
evt.preventDefault();
unhide();
var name = (/pass/).test(report.className) ? '' : ' pass';
report.className = report.className.replace(/fail|pass/g, '') + name;
Expand All @@ -90,7 +91,8 @@ function HTML(runner) {
});

// failure toggle
on(failuresLink, 'click', function() {
on(failuresLink, 'click', function(evt) {
evt.preventDefault();
unhide();
var name = (/fail/).test(report.className) ? '' : ' fail';
report.className = report.className.replace(/fail|pass/g, '') + name;
Expand Down

0 comments on commit 9e93efc

Please sign in to comment.