Skip to content

Latest commit

History

History
40 lines (31 loc) 路 1.16 KB

index.md

File metadata and controls

40 lines (31 loc) 路 1.16 KB
layout group title redirect_from
group
config
QUnit.config
/QUnit.config/
/config/QUnit.config/

General configuration options for QUnit.

Preconfiguring QUnit

If you load QUnit asynchronously or otherwise need to configure QUnit before it is loaded, you can predefine the configuration by creating a global variable QUnit with a config property.

The config values specified here will be carried over to the real QUnit.config object. Any other properties of this object will be ignored.

// Implicit global
// Supported everywhere, including old browsers. (But not ES strict mode.)
QUnit = {
  config: {
    autostart: false,
    maxDepth: 12
  }
};

// Browser global
// For all browsers (including strict mode and old browsers)
window.QUnit = { /* .. */ };

// Isomorphic global
// For modern browsers, SpiderMonkey, and Node.js (incl. strict mode).
globalThis.QUnit = { /* .. */ };

Changelog

| UNRELEASED | Preconfig support added for SpiderMonkey and other environments.
Previously, it was limited to the browser environment. | QUnit 2.1.0 | Preconfig feature introduced.