This change broke spec filtering in Karma by changing the format of the
`spec` query parameter. Although karma-jasmine-html-reporter uses
jasmine-core's HtmlSpecFilter, karm-jasmine provides its own spec filter
that interprets the query parameters itself.
This feature may be reintroduced in 6.0 as a breaking change.
This reverts commit 8309416cb2.
25 lines
761 B
JavaScript
25 lines
761 B
JavaScript
jasmineRequire.HtmlSpecFilter = function() {
|
|
// Legacy HTML spec filter, preserved for backward compatibility with
|
|
// boot files that predate HtmlExactSpecFilterV2
|
|
function HtmlSpecFilter(options) {
|
|
const filterString =
|
|
options &&
|
|
options.filterString() &&
|
|
options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
const filterPattern = new RegExp(filterString);
|
|
|
|
/**
|
|
* Determines whether the spec with the specified name should be executed.
|
|
* @name HtmlSpecFilter#matches
|
|
* @function
|
|
* @param {string} specName The full name of the spec
|
|
* @returns {boolean}
|
|
*/
|
|
this.matches = function(specName) {
|
|
return filterPattern.test(specName);
|
|
};
|
|
}
|
|
|
|
return HtmlSpecFilter;
|
|
};
|