API reference docs for HTML reporter and spec filters

This commit is contained in:
Steve Gravrock
2025-09-17 07:30:34 -07:00
parent 8309416cb2
commit fa481b2bd1
4 changed files with 90 additions and 0 deletions

View File

@@ -1,7 +1,19 @@
jasmineRequire.HtmlExactSpecFilter = function() {
/**
* Spec filter for use with {@link HtmlReporter}
*
* See lib/jasmine-core/boot1.js for usage.
* @since 5.11.0
*/
class HtmlExactSpecFilter {
#getFilterString;
/**
* 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}.
*/
constructor(options) {
if (typeof options?.filterString !== 'function') {
throw new Error('options.filterString must be a function');
@@ -10,6 +22,11 @@ jasmineRequire.HtmlExactSpecFilter = function() {
this.#getFilterString = options.filterString;
}
/**
* Determines whether the specified spec should be executed.
* @param {Spec} spec
* @returns {boolean}
*/
matches(spec) {
const filterString = this.#getFilterString();