@@ -154,8 +154,8 @@ assert.deepEqual(/a/gi, new Date());
154
154
<!-- YAML
155
155
added: v0.5.9
156
156
-->
157
- * ` value ` {any}
158
- * ` message ` {any }
157
+ * ` value ` {any} The input that is checked for being truthy.
158
+ * ` message ` {string|Error }
159
159
160
160
An alias of [ ` assert.ok() ` ] [ ] .
161
161
@@ -181,7 +181,7 @@ changes:
181
181
-->
182
182
* ` actual ` {any}
183
183
* ` expected ` {any}
184
- * ` message ` {any }
184
+ * ` message ` {string|Error }
185
185
186
186
** Strict mode**
187
187
@@ -235,18 +235,18 @@ const obj3 = {
235
235
const obj4 = Object .create (obj1);
236
236
237
237
assert .deepEqual (obj1, obj1);
238
- // OK, object is equal to itself
238
+ // OK
239
239
240
+ // Values of b are different:
240
241
assert .deepEqual (obj1, obj2);
241
242
// AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } }
242
- // values of b are different
243
243
244
244
assert .deepEqual (obj1, obj3);
245
- // OK, objects are equal
245
+ // OK
246
246
247
+ // Prototypes are ignored:
247
248
assert .deepEqual (obj1, obj4);
248
249
// AssertionError: { a: { b: 1 } } deepEqual {}
249
- // Prototypes are ignored
250
250
```
251
251
252
252
If the values are not equal, an ` AssertionError ` is thrown with a ` message `
@@ -285,7 +285,7 @@ changes:
285
285
-->
286
286
* ` actual ` {any}
287
287
* ` expected ` {any}
288
- * ` message ` {any }
288
+ * ` message ` {string|Error }
289
289
290
290
Tests for deep equality between the ` actual ` and ` expected ` parameters.
291
291
"Deep" equality means that the enumerable "own" properties of child objects
@@ -406,7 +406,7 @@ added: v10.0.0
406
406
-->
407
407
* ` block ` {Function|Promise}
408
408
* ` error ` {RegExp|Function}
409
- * ` message ` {any }
409
+ * ` message ` {string|Error }
410
410
411
411
Awaits the ` block ` promise or, if ` block ` is a function, immediately calls the
412
412
function and awaits the returned promise to complete. It will then check that
@@ -460,7 +460,7 @@ changes:
460
460
-->
461
461
* ` block ` {Function}
462
462
* ` error ` {RegExp|Function}
463
- * ` message ` {any }
463
+ * ` message ` {string|Error }
464
464
465
465
Asserts that the function ` block ` does not throw an error.
466
466
@@ -528,7 +528,7 @@ added: v0.1.21
528
528
-->
529
529
* ` actual ` {any}
530
530
* ` expected ` {any}
531
- * ` message ` {any }
531
+ * ` message ` {string|Error }
532
532
533
533
** Strict mode**
534
534
@@ -565,7 +565,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
565
565
<!-- YAML
566
566
added: v0.1.21
567
567
-->
568
- * ` message ` {any } ** Default:** ` 'Failed' `
568
+ * ` message ` {string|Error } ** Default:** ` 'Failed' `
569
569
570
570
Throws an ` AssertionError ` with the provided error message or a default error
571
571
message. If the ` message ` parameter is an instance of an [ ` Error ` ] [ ] then it
@@ -598,7 +598,7 @@ changes:
598
598
-->
599
599
* ` actual ` {any}
600
600
* ` expected ` {any}
601
- * ` message ` {any }
601
+ * ` message ` {string|Error }
602
602
* ` operator ` {string} ** Default:** ` '!=' `
603
603
* ` stackStartFunction ` {Function} ** Default:** ` assert.fail `
604
604
@@ -659,8 +659,8 @@ changes:
659
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
- description: Value may now only be `undefined` or `null`. Before any truthy
663
- input was accepted .
662
+ description: Value may now only be `undefined` or `null`. Before all falsy
663
+ values were handled the same as `null` and did not throw .
664
664
-->
665
665
* ` value ` {any}
666
666
@@ -717,7 +717,7 @@ changes:
717
717
-->
718
718
* ` actual ` {any}
719
719
* ` expected ` {any}
720
- * ` message ` {any }
720
+ * ` message ` {string|Error }
721
721
722
722
** Strict mode**
723
723
@@ -753,13 +753,13 @@ assert.notDeepEqual(obj1, obj1);
753
753
// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
754
754
755
755
assert .notDeepEqual (obj1, obj2);
756
- // OK: obj1 and obj2 are not deeply equal
756
+ // OK
757
757
758
758
assert .notDeepEqual (obj1, obj3);
759
759
// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
760
760
761
761
assert .notDeepEqual (obj1, obj4);
762
- // OK: obj1 and obj4 are not deeply equal
762
+ // OK
763
763
```
764
764
765
765
If the values are deeply equal, an ` AssertionError ` is thrown with a ` message `
@@ -798,7 +798,7 @@ changes:
798
798
-->
799
799
* ` actual ` {any}
800
800
* ` expected ` {any}
801
- * ` message ` {any }
801
+ * ` message ` {string|Error }
802
802
803
803
Tests for deep strict inequality. Opposite of [ ` assert.deepStrictEqual() ` ] [ ] .
804
804
@@ -821,7 +821,7 @@ added: v0.1.21
821
821
-->
822
822
* ` actual ` {any}
823
823
* ` expected ` {any}
824
- * ` message ` {any }
824
+ * ` message ` {string|Error }
825
825
826
826
** Strict mode**
827
827
@@ -863,7 +863,7 @@ changes:
863
863
-->
864
864
* ` actual ` {any}
865
865
* ` expected ` {any}
866
- * ` message ` {any }
866
+ * ` message ` {string|Error }
867
867
868
868
Tests strict inequality between the ` actual ` and ` expected ` parameters as
869
869
determined by the [ SameValue Comparison] [ ] .
@@ -897,7 +897,7 @@ changes:
897
897
error message.
898
898
-->
899
899
* ` value ` {any}
900
- * ` message ` {any }
900
+ * ` message ` {string|Error }
901
901
902
902
Tests if ` value ` is truthy. It is equivalent to
903
903
` assert.equal(!!value, true, message) ` .
@@ -960,7 +960,7 @@ added: v10.0.0
960
960
-->
961
961
* ` block ` {Function|Promise}
962
962
* ` error ` {RegExp|Function|Object|Error}
963
- * ` message ` {any }
963
+ * ` message ` {string|Error }
964
964
965
965
Awaits the ` block ` promise or, if ` block ` is a function, immediately calls the
966
966
function and awaits the returned promise to complete. It will then check that
@@ -1022,7 +1022,7 @@ changes:
1022
1022
-->
1023
1023
* ` actual ` {any}
1024
1024
* ` expected ` {any}
1025
- * ` message ` {any }
1025
+ * ` message ` {string|Error }
1026
1026
1027
1027
Tests strict equality between the ` actual ` and ` expected ` parameters as
1028
1028
determined by the [ SameValue Comparison] [ ] .
@@ -1065,7 +1065,7 @@ changes:
1065
1065
-->
1066
1066
* ` block ` {Function}
1067
1067
* ` error ` {RegExp|Function|Object|Error}
1068
- * ` message ` {any }
1068
+ * ` message ` {string|Error }
1069
1069
1070
1070
Expects the function ` block ` to throw an error.
1071
1071
0 commit comments