-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: Move QUnit/push page to assert/push, and improve migration docs
* Rename QUnit.push to assert.push. Back in QUnit 1.0, there was indeed a global function called QUnit.push, however it moved to the Assert class leading up to QUnit 2.0 with an alias from QUnit[name], same as for other assertion methods, such as `QUnit.equal()`. The actual global name for this has long been removed, back in QUnit 2.0, along with all the other global aliases, in commit a5aa1d8. We've never given aliases their own page, so move this page to be among its sibling Assert methods. This reflects the state of the code, and also makes its deprecated state less confusing as otherwise it would say that we removed QUnit.push in 2.0.0, and then deprecated it, after removing it, in QUnit 2.1.1, which doesn't make sense :) * Add redirect for the URL used between QUnit 2.1.1 and 2.4.0. Ref #1206. Easy enough!
- Loading branch information
Showing
6 changed files
with
49 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
layout: page-api | ||
title: assert.push() | ||
excerpt: Report the result of a custom assertion. | ||
groups: | ||
- deprecated | ||
redirect_from: | ||
- "/config/QUnit.push/" | ||
- "/extension/QUnit.push/" | ||
- "/api/extension/QUnit.push/" | ||
version_added: "1.0.0" | ||
version_deprecated: "2.1.1" | ||
--- | ||
|
||
`push( result, actual, expected, message )` | ||
|
||
Report the result of a custom assertion. | ||
|
||
<p class="note note--warning" markdown="1">This method is __deprecated__ and it's recommended to use [`assert.pushResult()`](../assert/pushResult.md) instead.</p> | ||
|
||
| name | description | | ||
|------|-------------| | ||
| `result` (boolean) | Result of the assertion | | ||
| `actual` | Expression being tested | | ||
| `expected` | Known comparison value | | ||
| `message` (string) | A short description of the assertion | | ||
|
||
`QUnit.assert.push()` relies on global state to push the assertion to the currently running test. This may leak assertions from asynchronous tests into an unrelated test. | ||
|
||
To create a QUnit assertion plugin, refer to [`assert.pushResult()`](../assert/pushResult.md). | ||
|
||
To safely report a global error from inside a plugin or other integration layer, without needing to know whether or which test is running, use [`QUnit.onUncaughtException()`](../extension/QUnit.onUncaughtException.md) instead. | ||
|
||
## Changelog | ||
|
||
| [QUnit 2.1.0](https://github.com/qunitjs/qunit/releases/tag/2.1.0) | Deprecated. Use `assert.pushResult` instead. | ||
| [QUnit 2.0.0](https://github.com/qunitjs/qunit/releases/tag/2.0.0)| Remove `QUnit.push` alias. | ||
| [QUnit 1.15.0](https://github.com/qunitjs/qunit/releases/tag/1.15.0) | Rename `QUnit.push` to `QUnit.assert.push`, with alias. |
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 was deleted.
Oops, something went wrong.
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