QUnit.start()
version added: 1.0.0.
Description
QUnit.start()
Call this method to start the test runner. This indicates that all relevant source code has been loaded and all tests have been defined.
In most environments this is automatically called and you do not need to call it. This includes testing in a browser environment, and the QUnit CLI.
If you build a custom test runner (such in SpiderMonkey or Node.js), or if you disable QUnit.config.autostart
and load test files asynchronously (with AMD, RequireJS, or ESM dynamic imports), then you need to call this once after your test files have been loaded.
See QUnit.config.autostart
for detailed examples of how to use QUnit.start()
.
Prior to QUnit 1.16, this method was used for resuming an async QUnit.test()
function, as complement to QUnit.stop()
. To resume asynchronous tests, use assert.async()
instead.
Changelog
QUnit 2.1.1 | QUnit.start() no longer requires calling QUnit.load() first. |
QUnit 2.0 | Support for calling start() to resume an async test was removed. (Migration guide) |
QUnit 1.16 | Use of start() to resume an async test was deprecated in favour of assert.async() . |