Move knowledge of query parameters out of boot1.js

This commit is contained in:
Steve Gravrock
2025-09-17 18:23:45 -07:00
parent fa481b2bd1
commit 6715f24fd0
7 changed files with 63 additions and 58 deletions

View File

@@ -10,16 +10,13 @@ jasmineRequire.HtmlExactSpecFilter = function() {
/**
* Create a filter instance.
* @param options Object with a filterString method, which should
* return the value of the "spec" query string parameter set by
* {@link HtmlReporter}.
* @param options Object with a queryString property, which should be an
* instance of {@link QueryString}.
*/
constructor(options) {
if (typeof options?.filterString !== 'function') {
throw new Error('options.filterString must be a function');
}
this.#getFilterString = options.filterString;
this.#getFilterString = function() {
return options.queryString.getParam('spec');
};
}
/**

View File

@@ -64,10 +64,14 @@ jasmineRequire.HtmlReporter = function(j$) {
const getContainer = options.getContainer;
const createElement = options.createElement;
const createTextNode = options.createTextNode;
// TODO: in the next major release, replace navigateWithNewParam and
// addToExistingQueryString with direct usage of options.queryString
const navigateWithNewParam = options.navigateWithNewParam || function() {};
const addToExistingQueryString =
options.addToExistingQueryString || defaultQueryString;
const filterSpecs = options.filterSpecs;
const filterSpecs = options.queryString
? !!options.queryString.getParam('spec')
: options.filterSpecs; // For compatibility with pre-5.11 boot files
let htmlReporterMain;
let symbols;
const deprecationWarnings = [];