forked from qunitjs/qunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Deprecate
QUnit.load()
and document migration path
Based on qunitjs#1502 by @smcclure15. Closes qunitjs#1084. Co-authored-by: Steve <[email protected]>
- Loading branch information
1 parent
552ad59
commit 93a63b5
Showing
7 changed files
with
87 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
layout: page-api | ||
title: QUnit.load() | ||
excerpt: Notify the test runner to consider starting test execution. | ||
groups: | ||
- deprecated | ||
redirect_from: | ||
- "/start/" | ||
version_added: "1.0.0" | ||
version_deprecated: "unreleased" | ||
--- | ||
|
||
`QUnit.load()` | ||
|
||
Notify the test runner to try to start test execution. | ||
|
||
This is an internal method that previously facilitated [`QUnit.config.autostart`](../config/autostart.md) in a web browser context. When QUnit is already started, or if `QUnit.config.autostart` is false, then calls to `QUnit.load()` are silently ignored. | ||
|
||
<p class="note note--warning" markdown="1">This method is __deprecated__. Remove call, or replace by a single call to [`QUnit.start()`](./start.md).</p> | ||
|
||
## Changelog | ||
|
||
| UNRELEASED | Deprecated. Use [`QUnit.start()`](./start.md) instead. | ||
| [QUnit 2.1.1](https://github.com/qunitjs/qunit/releases/tag/2.1.1) | `QUnit.start()` no longer requires calling `QUnit.load()` first. | ||
|
||
## Migration examples | ||
|
||
If you still call `QUnit.load()` with QUnit 2.2 or later, the call is usually redundant and safe to remove (including before you upgrade to QUnit 3). | ||
|
||
## Calling both `QUnit.load()` and `QUnit.start()` | ||
|
||
If your project started with QUnit 1.x, and you use `QUnit.config.autostart = false`, then you might be calling both of these methods. [`QUnit.start()`](./start.md) previously required calling `QUnit.load()`. | ||
|
||
This has not been needed since [QUnit 2.1.1](https://github.com/qunitjs/qunit/releases/tag/2.1.1), and the call to `QUnit.load()` is safe to remove. | ||
|
||
## Calling only `QUnit.load()` | ||
|
||
Prior to QUnit 2.21, the built-in HTML Reporter called `QUnit.load()` from the window.onload event, which in turn gracefully calls `QUnit.start()` if it has not been called already. | ||
|
||
If your test runner works in a similar way, call [`QUnit.start()`](./start.md) instead of `QUnit.load()`. This will solve the deprecation warning and prepares you for QUnit 3. | ||
|
||
## Calling neither | ||
|
||
Calling neither requires no changes. Refer to [`QUnit.start()`](./start.md) if you're curious how this is automatically called for you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters