assert.push()

version added: 1.0.0. deprecated: 2.1.1.

Description

push( result, actual, expected, message )

Report the result of a custom assertion.

This method is deprecated and it’s recommended to use assert.pushResult() 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.

Changelog

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.