deepEqual()
Categories: Assert
deepEqual( actual, expected, message )
Description: A deep recursive comparison assertion, working on primitive types, arrays, objects, regular expressions, dates and functions.
-
deepEqual( actual, expected, message )
-
actualType: ObjectObject or Expression being tested
-
expectedType: ObjectKnown comparison value
-
messageType: StringA short description of the assertion
-
The deepEqual()
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 deepEqual
.
notDeepEqual()
can be used to explicitly test deep, strict inequality.
Example:
Compare the value of two objects.
1
2
3
4
5
|
|