notEqual()


notEqual( actual, expected [, message ] )

Description: A non-strict comparison, checking for inequality.

The notEqual assertion uses the simple inverted comparison operator (!=) to compare the actual and expected arguments. When they aren't equal, the assertion passes; otherwise, it fails. When it fails, both actual and expected values are displayed in the test result, in addition to a given message.

equal() can be used to test equality.

notStrictEqual() can be used to test strict inequality.

Example:

The simplest assertion example:

1
2
3
QUnit.test( "a test", function( assert ) {
assert.notEqual( 1, "2", "String '2' and number 1 don't have the same value" );
});