notDeepEqual()


notDeepEqual( actual, expected [, message ] )

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

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.

Example:

Compare the value of two objects.

1
2
3
4
5
QUnit.test( "notDeepEqual test", function( assert ) {
var obj = { foo: "bar" };
assert.notDeepEqual( obj, { foo: "bla" }, "Different object, same key, different value, not equal" );
});