Skip to content

Latest commit

History

History
38 lines (28 loc) 路 1.21 KB

notEqual.md

File metadata and controls

38 lines (28 loc) 路 1.21 KB
layout title description categories redirect_from
default
notEqual
A non-strict comparison, checking for inequality.
assert
/notEqual
/notEqual/

notEqual( actual, expected [, message ] )

A non-strict comparison, checking for inequality.

name description
actual Expression being tested
expected Known comparison value
message (string) A short description of the assertion

Description

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.

Examples

The simplest assertion example:

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