Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
layout group title redirect_from

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 = { /* .. */ };


| 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.