Move knowledge of query parameters out of boot1.js
This commit is contained in:
@@ -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');
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user