☕️ Classic, reliable, trusted test framework for Node.js and the browser
HTML reporter: preserve query params when navigating to suites/tests
Christopher Hiller91828f981154
diff --git a/lib/reporters/html.js b/lib/reporters/html.jsindex 8b44e3ed..8c41f055 100644--- a/lib/reporters/html.js+++ b/lib/reporters/html.js@@ -177,14 +177,23 @@ function HTML(runner) {});}+/**+ * Makes a URL, preserving querystring ("search") parameters.+ * @param {string} s+ * @returns {string} your new URL+ */+var makeUrl = function makeUrl(s) {+ var search = window.location.search;+ return (search ? search + '&' : '?' ) + 'grep=' + encodeURIComponent(s);+};+/*** Provide suite URL** @param {Object} [suite]*/-HTML.prototype.suiteURL = function(suite){- return '?grep=' + encodeURIComponent(suite.fullTitle());+ return makeUrl(suite.fullTitle());};/**@@ -194,7 +203,7 @@ HTML.prototype.suiteURL = function(suite){*/HTML.prototype.testURL = function(test){- return '?grep=' + encodeURIComponent(test.fullTitle());+ return makeUrl(test.fullTitle());};/**