Skip to content

Latest commit

History

History
38 lines (28 loc) 路 1.31 KB

notDeepEqual.md

File metadata and controls

38 lines (28 loc) 路 1.31 KB
layout title description categories redirect_from
default
notDeepEqual
An inverted deep recursive comparison, working on primitive types, arrays, objects, regular expressions, dates and functions.
assert
/notDeepEqual
/notDeepEqual/

notDeepEqual( actual, expected [, message ] )

An inverted deep recursive comparison, working on primitive types, arrays, objects, regular expressions, dates and functions.

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

Description

The notDeepEqual() assertion can be used just like equal() when comparing the value of objects, such that { key: value } is equal to { key: value }. For non-scalar values, identity will be disregarded by notDeepEqual.

deepEqual() can be used to explicitly test deep, strict equality.

Examples

Compare the value of two objects.

QUnit.test( "notDeepEqual test", function( assert ) {
  var obj = { foo: "bar" };

  assert.notDeepEqual( obj, { foo: "bla" }, "Different object, same key, different value, not equal" );
});