@@ -165,10 +165,10 @@ added: v0.1.21
165
165
changes:
166
166
- version: v9.0.0
167
167
pr-url: https://github.com/nodejs/node/pull/15001
168
- description: Error names and messages are now properly compared
168
+ description: The ` Error` names and messages are now properly compared
169
169
- version: v8.0.0
170
170
pr-url: https://github.com/nodejs/node/pull/12142
171
- description: Set and Map content is also compared
171
+ description: The ` Set` and ` Map` content is also compared
172
172
- version: v6.4.0, v4.7.1
173
173
pr-url: https://github.com/nodejs/node/pull/8002
174
174
description: Typed array slices are handled correctly now.
@@ -208,7 +208,7 @@ the [`RegExp`][] object are not enumerable:
208
208
assert .deepEqual (/ a/ gi , new Date ());
209
209
```
210
210
211
- An exception is made for [ ` Map ` ] [ ] and [ ` Set ` ] [ ] . Maps and Sets have their
211
+ An exception is made for [ ` Map ` ] [ ] and [ ` Set ` ] [ ] . ` Map ` s and ` Set ` s have their
212
212
contained items compared too, as expected.
213
213
214
214
"Deep" equality means that the enumerable "own" properties of child objects
@@ -264,15 +264,15 @@ changes:
264
264
description: Enumerable symbol properties are now compared.
265
265
- version: v9.0.0
266
266
pr-url: https://github.com/nodejs/node/pull/15036
267
- description: NaN is now compared using the
267
+ description: The ` NaN` is now compared using the
268
268
[SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero)
269
269
comparison.
270
270
- version: v8.5.0
271
271
pr-url: https://github.com/nodejs/node/pull/15001
272
- description: Error names and messages are now properly compared
272
+ description: The ` Error` names and messages are now properly compared
273
273
- version: v8.0.0
274
274
pr-url: https://github.com/nodejs/node/pull/12142
275
- description: Set and Map content is also compared
275
+ description: The ` Set` and ` Map` content is also compared
276
276
- version: v6.4.0, v4.7.1
277
277
pr-url: https://github.com/nodejs/node/pull/8002
278
278
description: Typed array slices are handled correctly now.
@@ -303,8 +303,8 @@ are recursively evaluated also by the following rules.
303
303
enumerable properties.
304
304
* Enumerable own [ ` Symbol ` ] [ ] properties are compared as well.
305
305
* [ Object wrappers] [ ] are compared both as objects and unwrapped values.
306
- * Object properties are compared unordered.
307
- * Map keys and Set items are compared unordered.
306
+ * ` Object ` properties are compared unordered.
307
+ * ` Map ` keys and ` Set ` items are compared unordered.
308
308
* Recursion stops when both sides differ or both sides encounter a circular
309
309
reference.
310
310
* [ ` WeakMap ` ] [ ] and [ ` WeakSet ` ] [ ] comparison does not rely on their values. See
@@ -413,10 +413,10 @@ function and awaits the returned promise to complete. It will then check that
413
413
the promise is not rejected.
414
414
415
415
If ` block ` is a function and it throws an error synchronously,
416
- ` assert.doesNotReject() ` will return a rejected Promise with that error. If the
417
- function does not return a promise, ` assert.doesNotReject() ` will return a
418
- rejected Promise with an [ ` ERR_INVALID_RETURN_VALUE ` ] [ ] error. In both cases the
419
- error handler is skipped.
416
+ ` assert.doesNotReject() ` will return a rejected ` Promise ` with that error. If
417
+ the function does not return a promise, ` assert.doesNotReject() ` will return a
418
+ rejected ` Promise ` with an [ ` ERR_INVALID_RETURN_VALUE ` ] [ ] error. In both cases
419
+ the error handler is skipped.
420
420
421
421
Please note: Using ` assert.doesNotReject() ` is actually not useful because there
422
422
is little benefit by catching a rejection and then rejecting it again. Instead,
@@ -494,7 +494,7 @@ assert.doesNotThrow(
494
494
```
495
495
496
496
However, the following will result in an ` AssertionError ` with the message
497
- 'Got unwanted exception (TypeError) ..':
497
+ 'Got unwanted exception. ..':
498
498
499
499
<!-- eslint-disable no-restricted-syntax -->
500
500
``` js
@@ -519,7 +519,7 @@ assert.doesNotThrow(
519
519
/ Wrong value/ ,
520
520
' Whoops'
521
521
);
522
- // Throws: AssertionError: Got unwanted exception (TypeError). Whoops
522
+ // Throws: AssertionError: Got unwanted exception: Whoops
523
523
```
524
524
525
525
## assert.equal(actual, expected[ , message] )
@@ -656,7 +656,7 @@ changes:
656
656
- version: v10.0.0
657
657
pr-url: https://github.com/nodejs/node/pull/18247
658
658
description: Instead of throwing the original error it is now wrapped into
659
- a AssertionError that contains the full stack trace.
659
+ an ` AssertionError` that contains the full stack trace.
660
660
- version: v10.0.0
661
661
pr-url: https://github.com/nodejs/node/pull/18247
662
662
description: Value may now only be `undefined` or `null`. Before any truthy
@@ -701,10 +701,10 @@ added: v0.1.21
701
701
changes:
702
702
- version: v9.0.0
703
703
pr-url: https://github.com/nodejs/node/pull/15001
704
- description: Error names and messages are now properly compared
704
+ description: The ` Error` names and messages are now properly compared
705
705
- version: v8.0.0
706
706
pr-url: https://github.com/nodejs/node/pull/12142
707
- description: Set and Map content is also compared
707
+ description: The ` Set` and ` Map` content is also compared
708
708
- version: v6.4.0, v4.7.1
709
709
pr-url: https://github.com/nodejs/node/pull/8002
710
710
description: Typed array slices are handled correctly now.
@@ -774,18 +774,18 @@ added: v1.2.0
774
774
changes:
775
775
- version: v9.0.0
776
776
pr-url: https://github.com/nodejs/node/pull/15398
777
- description: -0 and +0 are not considered equal anymore.
777
+ description: The `-0` and `+0` are not considered equal anymore.
778
778
- version: v9.0.0
779
779
pr-url: https://github.com/nodejs/node/pull/15036
780
- description: NaN is now compared using the
780
+ description: The ` NaN` is now compared using the
781
781
[SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero)
782
782
comparison.
783
783
- version: v9.0.0
784
784
pr-url: https://github.com/nodejs/node/pull/15001
785
- description: Error names and messages are now properly compared
785
+ description: The ` Error` names and messages are now properly compared
786
786
- version: v8.0.0
787
787
pr-url: https://github.com/nodejs/node/pull/12142
788
- description: Set and Map content is also compared
788
+ description: The ` Set` and ` Map` content is also compared
789
789
- version: v6.4.0, v4.7.1
790
790
pr-url: https://github.com/nodejs/node/pull/8002
791
791
description: Typed array slices are handled correctly now.
@@ -893,7 +893,8 @@ added: v0.1.21
893
893
changes:
894
894
- version: v10.0.0
895
895
pr-url: https://github.com/nodejs/node/pull/18319
896
- description: assert.ok() (no arguments) will now use a predefined error msg.
896
+ description: The `assert.ok()` (no arguments) will now use a predefined
897
+ error message.
897
898
-->
898
899
* ` value ` {any}
899
900
* ` message ` {any}
@@ -907,7 +908,7 @@ parameter is `undefined`, a default error message is assigned. If the `message`
907
908
parameter is an instance of an [ ` Error ` ] [ ] then it will be thrown instead of the
908
909
` AssertionError ` .
909
910
If no arguments are passed in at all ` message ` will be set to the string:
910
- " No value argument passed to assert.ok" .
911
+ `` ' No value argument passed to ` assert.ok()`' `` .
911
912
912
913
Be aware that in the ` repl ` the error message will be different to the one
913
914
thrown in a file! See below for further details.
@@ -966,9 +967,9 @@ function and awaits the returned promise to complete. It will then check that
966
967
the promise is rejected.
967
968
968
969
If ` block ` is a function and it throws an error synchronously,
969
- ` assert.rejects() ` will return a rejected Promise with that error. If the
970
+ ` assert.rejects() ` will return a rejected ` Promise ` with that error. If the
970
971
function does not return a promise, ` assert.rejects() ` will return a rejected
971
- Promise with an [ ` ERR_INVALID_RETURN_VALUE ` ] [ ] error. In both cases the error
972
+ ` Promise ` with an [ ` ERR_INVALID_RETURN_VALUE ` ] [ ] error. In both cases the error
972
973
handler is skipped.
973
974
974
975
Besides the async nature to await the completion behaves identically to
0 commit comments