Back to Qunit

QUnit.push()

docs/api/extension/QUnit.push.md

2.26.0823 B
Original Source

QUnit.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 [`pushResult`](../assert/pushResult.md) in the assertion context instead.</p>
namedescription
result (boolean)Result of the assertion
actualExpression being tested
expectedKnown comparison value
message (string)A short description of the assertion

QUnit.push reflects to the current running test, and it may leak assertions in asynchronous mode. Checkout assert.pushResult() to set a proper custom assertion.

Invoking QUnit.push allows to create a readable expectation that is not defined by any of QUnit's built-in assertions.