QUnit.reporters.html

version added: 1.0.0.

Description

The html reporter renders a toolbar that lets you filter which modules or tests run, visualizes test results with diffs, provides “Rerun” links for individual tests, and more. This is enabled by default in Browser environments

The HTML Reporter is documented in detail at Browser § HTML Reporter.

Usage

By default, the HTML Reporter is automatically enabled in browser environments if a <div id="qunit"> element exists. If such element doesn’t exist, it remains disabled (“headless”).

You can override this and disable the HTML Reporter even if the element does exist. For example, to share and reuse the same HTML file for CI, debugging, and manual testing; but disable the HTML Reporter in CI for improved performance.

Example

// Preconfig: Set as global variable before loading qunit.js
qunit_config_reporters_html = false;

Or

// Config: Set from any inline script or JS file after qunit.js
QUnit.config.reporters.html = false;

Changelog

UNRELEASED Toggle declaratively via QUnit.config.reporters.
QUnit 1.0.0 Initial release.