Clone HtmlSpecFilter and HtmlReporter in preparation for backward-incompatible changes

This commit is contained in:
Steve Gravrock
2025-10-07 20:38:01 -07:00
parent bd89ef66c8
commit 77c3b8b07e
12 changed files with 2143 additions and 95 deletions

View File

@@ -0,0 +1,24 @@
jasmineRequire.HtmlSpecFilterV2 = function() {
'use strict';
function HtmlSpecFilterV2(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 HtmlSpecFilterV2;
};