QUnit.config

General configuration options for QUnit.

Preconfiguring QUnit

If you want to configure QUnit before it is loaded, you can introduce the global variable QUnit with the property config specified. All other properties of the QUnit object will be ignored. In the config properties you may specify any of the allowed QUnit.config values.

// QUnit is not yet loaded here
window.QUnit = {
  config: {
    autostart: false,
    noglobals: true,
  }
};

QUnit.config.altertitle

Insert a success or failure symbol in the document title (HTML Reporter).

QUnit.config.autostart

Start running the tests once all files have been loaded.

QUnit.config.collapse

Collapse the details of failing tests after the first one (HTML Reporter).

QUnit.config.current

Internal object representing the currently running test.

QUnit.config.failOnZeroTests

Fail the test run if no tests were run.

QUnit.config.filter

Decide which tests should run based on a substring or pattern match.

QUnit.config.fixture

HTML content to render in the fixture container at the start of each test (HTML Reporter).

QUnit.config.hidepassed

Hide results of passed tests (HTML Reporter).

QUnit.config.maxDepth

The depth up-to which an object will be serialized during a diff (HTML Reporter).

QUnit.config.module

Select a single test module to run, by name.

QUnit.config.moduleId

Select one or more modules to run, by their internal ID (HTML Reporter).

QUnit.config.noglobals

Check the global object after each test and report new properties as failures.

QUnit.config.notrycatch

Disable handling of uncaught exceptions during tests.

QUnit.config.reorder

Allow re-running of previously failed tests out of order.

QUnit.config.requireExpects

Fail tests that don't specify how many assertions they expect.

QUnit.config.scrolltop

Scroll to the top of the page after the test run (HTML Reporter).

QUnit.config.seed

Enable randomized ordering of tests.

QUnit.config.storage

The Storage object to use for remembering failed tests between runs.

QUnit.config.testId

Select one or more tests to run, by their internal ID (HTML Reporter).

QUnit.config.testTimeout

Set a global default timeout after which a test will fail.

QUnit.config.urlConfig

Register additional input fields in the toolbar (HTML Reporter).