@@ -107,6 +107,9 @@ parameter is undefined, a default error message is assigned.
107
107
<!-- YAML
108
108
added: v1.2.0
109
109
changes:
110
+ - version: REPLACEME
111
+ pr-url: https://github.com/nodejs/node/pull/15036
112
+ description: NaN is now compared using the [SameValueZero][] comparison.
110
113
- version: REPLACEME
111
114
pr-url: https://github.com/nodejs/node/pull/15001
112
115
description: Error names and messages are now properly compared
@@ -129,9 +132,10 @@ changes:
129
132
130
133
Generally identical to ` assert.deepEqual() ` with three exceptions:
131
134
132
- 1 . Primitive values are compared using the [ Strict Equality Comparison] [ ]
133
- ( ` === ` ). Set values and Map keys are compared using the [ SameValueZero] [ ]
134
- comparison. (Which means they are free of the [ caveats] [ ] ).
135
+ 1 . Primitive values besides ` NaN ` are compared using the [ Strict Equality
136
+ Comparison] [ ] ( ` === ` ). Set and Map values, Map keys and ` NaN ` are compared
137
+ using the [ SameValueZero] [ ] comparison (which means they are free of the
138
+ [ caveats] [ ] ).
135
139
2 . [ ` [[Prototype]] ` ] [ prototype-spec ] of objects are compared using
136
140
the [ Strict Equality Comparison] [ ] too.
137
141
3 . [ Type tags] [ Object.prototype.toString() ] of objects should be the same.
@@ -164,6 +168,8 @@ assert.deepEqual(date, fakeDate);
164
168
assert .deepStrictEqual (date, fakeDate);
165
169
// AssertionError: 2017-03-11T14:25:31.849Z deepStrictEqual Date {}
166
170
// Different type tags
171
+ assert .deepStrictEqual (NaN , NaN );
172
+ // OK, because of the SameValueZero comparison
167
173
```
168
174
169
175
If the values are not equal, an ` AssertionError ` is thrown with a ` message `
@@ -412,6 +418,9 @@ parameter is undefined, a default error message is assigned.
412
418
<!-- YAML
413
419
added: v1.2.0
414
420
changes:
421
+ - version: REPLACEME
422
+ pr-url: https://github.com/nodejs/node/pull/15036
423
+ description: NaN is now compared using the [SameValueZero][] comparison.
415
424
- version: REPLACEME
416
425
pr-url: https://github.com/nodejs/node/pull/15001
417
426
description: Error names and messages are now properly compared
0 commit comments