Documentation Home
This page describes a pre-release version of Jasmine (6.0.0-alpha.1). There may be additional changes, including breaking changes, before the final 6.0.0 release.
The current stable version of Jasmine is 5.12.

Class: HtmlReporterV2

HtmlReporterV2(options)

Displays results and allows re-running individual specs and suites.

Constructor

new HtmlReporterV2(options)

Parameters:
Name Type Description
options

Options object

Since:
  • 6.0.0
Implements:
Example
const env = jasmine.getEnv();
const urls = new jasmine.HtmlReporterV2Urls();
const reporter = new jasmine.HtmlReporterV2({
   env,
   urls,
   container: document.body
});

Methods

jasmineDone(suiteInfo, doneopt)

When the entire suite has finished execution jasmineDone is called

Parameters:
Name Type Attributes Description
suiteInfo JasmineDoneInfo

Information about the full Jasmine suite that just finished running.

done function <optional>

Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.

Implements:
See:
Returns:

Optionally return a Promise instead of using done to cause Jasmine to wait for completion.

jasmineStarted(suiteInfo, doneopt)

jasmineStarted is called after all of the specs have been loaded, but just before execution starts.

Parameters:
Name Type Attributes Description
suiteInfo JasmineStartedInfo

Information about the full Jasmine suite that is being run

done function <optional>

Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.

Implements:
See:
Returns:

Optionally return a Promise instead of using done to cause Jasmine to wait for completion.

specDone(result, doneopt)

specDone is invoked when an it and its associated beforeEach and afterEach functions have been run.

While jasmine doesn't require any specific functions, not defining a specDone will make it impossible for a reporter to know when a spec has failed.

Parameters:
Name Type Attributes Description
result SpecDoneEvent
done function <optional>

Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.

Implements:
See:
Returns:

Optionally return a Promise instead of using done to cause Jasmine to wait for completion.

suiteDone(result, doneopt)

suiteDone is invoked when all of the child specs and suites for a given suite have been run

While jasmine doesn't require any specific functions, not defining a suiteDone will make it impossible for a reporter to know when a suite has failures in an afterAll.

Parameters:
Name Type Attributes Description
result SuiteDoneEvent
done function <optional>

Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.

Implements:
See:
Returns:

Optionally return a Promise instead of using done to cause Jasmine to wait for completion.

suiteStarted(result, doneopt)

suiteStarted is invoked when a describe starts to run

Parameters:
Name Type Attributes Description
result SuiteStartedEvent

Information about the individual describe being run

done function <optional>

Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.

Implements:
See:
Returns:

Optionally return a Promise instead of using done to cause Jasmine to wait for completion.