Back to Qunit

QUnit.reporters.console

docs/api/reporters/console.md

2.25.01.2 KB
Original Source

The console reporter logs a JSON object from all QUnit.on reporting events.

Use this to explore or debug the QUnit event emitter.

Example

runStart {…}
testStart {…}
testEnd {…}
testStart {…}
testEnd {…}
runEnd {…}

Usage

QUnit CLI:

sh
qunit --reporter console test/

Enable manually in JavaScript code:

js
QUnit.reporters.console.init(QUnit);

Enable declaratively via QUnit.config:

js
// Preconfig:
// Set as environment variable to Node.js,
// or as global variable before loading qunit.js
qunit_config_reporters_console = true;

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

Changelog

| QUnit 2.24.0 | Enable declaratively via QUnit.config.reporters. | QUnit 2.16.0 | Exposed as QUnit.reporters.perf for programmatic usage. | QUnit 2.3.0 | Introduced as part of the QUnit CLI and --reporter console.