| layout | page-api | |||
|---|---|---|---|---|
| title | assert.push() | |||
| excerpt | Report the result of a custom assertion. | |||
| groups |
|
|||
| redirect_from |
|
|||
| version_added | 1.0.0 | |||
| version_deprecated | 2.1.1 |
push( result, actual, expected, message )
Report the result of a custom assertion.
This method is __deprecated__ and it's recommended to use [`assert.pushResult()`](../assert/pushResult.md) instead.
| 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().
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() instead.
| QUnit 2.1.0 | Deprecated. Use assert.pushResult instead.
| QUnit 2.0.0| Remove QUnit.push alias.
| QUnit 1.15.0 | Rename QUnit.push to QUnit.assert.push, with alias.