From 2704d298acbb09ed7ec713e7939fd6e803b6c43c Mon Sep 17 00:00:00 2001 From: jimenglish81 Date: Thu, 18 Feb 2016 20:36:56 +0000 Subject: [PATCH] preventDefault on html reporter failure/passed links to stop browser url updating --- lib/reporters/html.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/reporters/html.js b/lib/reporters/html.js index 95fc1e9f73..9a9b7245ea 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -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; @@ -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;