Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (31 loc) · 1.2 KB

index.md

File metadata and controls

40 lines (31 loc) · 1.2 KB
layout group title redirect_from
group
config
QUnit.config
/QUnit.config/
/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

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