Flesh out jasmine-html.js API reference

This commit is contained in:
Steve Gravrock
2025-10-15 21:50:56 -07:00
parent 2352249441
commit b6426d2414
5 changed files with 54 additions and 10 deletions

View File

@@ -53,7 +53,7 @@ jasmineRequire.HtmlReporter = function(j$) {
* @implements {Reporter}
* @param options Options object. See lib/jasmine-core/boot1.js for details.
* @since 1.2.0
* @deprecated
* @deprecated Use {@link HtmlReporterV2} instead.
*/
class HtmlReporter {
#env;
@@ -263,6 +263,11 @@ jasmineRequire.HtmlReporter = function(j$) {
jasmineRequire.HtmlSpecFilter = function(j$) {
'use strict';
/**
* @class HtmlSpecFilter
* @param options Options object. See lib/jasmine-core/boot1.js for details.
* @deprecated Use {@link HtmlReporterV2Urls} instead.
*/
function HtmlSpecFilter(options) {
j$.getEnv().deprecated(
'HtmlReporter and HtmlSpecFilter are deprecated. Use HtmlReporterV2 instead.'
@@ -280,7 +285,6 @@ jasmineRequire.HtmlSpecFilter = function(j$) {
* @function
* @param {string} specName The full name of the spec
* @returns {boolean}
* @deprcated
*/
this.matches = function(specName) {
return filterPattern.test(specName);
@@ -998,8 +1002,16 @@ jasmineRequire.HtmlReporterV2 = function(j$) {
* @class HtmlReporterV2
* @classdesc Displays results and allows re-running individual specs and suites.
* @implements {Reporter}
* @param options Options object. See lib/jasmine-core/boot1.js for details.
* @param options Options object
* @since 6.0.0
* @example
* const env = jasmine.getEnv();
* const urls = new jasmine.HtmlReporterV2Urls();
* const reporter = new jasmine.HtmlReporterV2({
* env,
* urls,
* container: document.body
* });
*/
class HtmlReporterV2 {
#env;
@@ -1249,7 +1261,11 @@ jasmineRequire.HtmlReporterV2Urls = function(j$) {
'use strict';
// TODO unify with V2 UrlBuilder?
// TODO jsdoc
/**
* @class HtmlReporterV2Urls
* @classdesc Processes URLs for {@link HtmlReporterV2}.
* @since 6.0.0
*/
class HtmlReporterV2Urls {
constructor(options = {}) {
// queryString is injectable for use in our own tests, but user code will
@@ -1263,7 +1279,13 @@ jasmineRequire.HtmlReporterV2Urls = function(j$) {
});
}
// TODO jsdoc. This is public.
/**
* Creates a {@link Configuration} from the current page's URL.
* @returns {Configuration}
* @example
* const urls = new jasmine.HtmlReporterV2Urls();
* env.configure(urls.configFromCurrentUrl());
*/
configFromCurrentUrl() {
const config = {
stopOnSpecFailure: this.queryString.getParam('stopOnSpecFailure'),

View File

@@ -9,7 +9,7 @@ jasmineRequire.HtmlReporter = function(j$) {
* @implements {Reporter}
* @param options Options object. See lib/jasmine-core/boot1.js for details.
* @since 1.2.0
* @deprecated
* @deprecated Use {@link HtmlReporterV2} instead.
*/
class HtmlReporter {
#env;

View File

@@ -7,8 +7,16 @@ jasmineRequire.HtmlReporterV2 = function(j$) {
* @class HtmlReporterV2
* @classdesc Displays results and allows re-running individual specs and suites.
* @implements {Reporter}
* @param options Options object. See lib/jasmine-core/boot1.js for details.
* @param options Options object
* @since 6.0.0
* @example
* const env = jasmine.getEnv();
* const urls = new jasmine.HtmlReporterV2Urls();
* const reporter = new jasmine.HtmlReporterV2({
* env,
* urls,
* container: document.body
* });
*/
class HtmlReporterV2 {
#env;

View File

@@ -2,7 +2,11 @@ jasmineRequire.HtmlReporterV2Urls = function(j$) {
'use strict';
// TODO unify with V2 UrlBuilder?
// TODO jsdoc
/**
* @class HtmlReporterV2Urls
* @classdesc Processes URLs for {@link HtmlReporterV2}.
* @since 6.0.0
*/
class HtmlReporterV2Urls {
constructor(options = {}) {
// queryString is injectable for use in our own tests, but user code will
@@ -16,7 +20,13 @@ jasmineRequire.HtmlReporterV2Urls = function(j$) {
});
}
// TODO jsdoc. This is public.
/**
* Creates a {@link Configuration} from the current page's URL.
* @returns {Configuration}
* @example
* const urls = new jasmine.HtmlReporterV2Urls();
* env.configure(urls.configFromCurrentUrl());
*/
configFromCurrentUrl() {
const config = {
stopOnSpecFailure: this.queryString.getParam('stopOnSpecFailure'),

View File

@@ -1,6 +1,11 @@
jasmineRequire.HtmlSpecFilter = function(j$) {
'use strict';
/**
* @class HtmlSpecFilter
* @param options Options object. See lib/jasmine-core/boot1.js for details.
* @deprecated Use {@link HtmlReporterV2Urls} instead.
*/
function HtmlSpecFilter(options) {
j$.getEnv().deprecated(
'HtmlReporter and HtmlSpecFilter are deprecated. Use HtmlReporterV2 instead.'
@@ -18,7 +23,6 @@ jasmineRequire.HtmlSpecFilter = function(j$) {
* @function
* @param {string} specName The full name of the spec
* @returns {boolean}
* @deprcated
*/
this.matches = function(specName) {
return filterPattern.test(specName);