chai 3.4.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,7 @@ module.exports = function (chai, util) {
29
29
  * @param {Mixed} expression to test for truthiness
30
30
  * @param {String} message to display on error
31
31
  * @name assert
32
+ * @namespace Assert
32
33
  * @api public
33
34
  */
34
35
 
@@ -51,6 +52,7 @@ module.exports = function (chai, util) {
51
52
  * @param {Mixed} expected
52
53
  * @param {String} message
53
54
  * @param {String} operator
55
+ * @namespace Assert
54
56
  * @api public
55
57
  */
56
58
 
@@ -75,6 +77,7 @@ module.exports = function (chai, util) {
75
77
  * @alias ok
76
78
  * @param {Mixed} object to test
77
79
  * @param {String} message
80
+ * @namespace Assert
78
81
  * @api public
79
82
  */
80
83
 
@@ -94,6 +97,7 @@ module.exports = function (chai, util) {
94
97
  * @alias notOk
95
98
  * @param {Mixed} object to test
96
99
  * @param {String} message
100
+ * @namespace Assert
97
101
  * @api public
98
102
  */
99
103
 
@@ -112,6 +116,7 @@ module.exports = function (chai, util) {
112
116
  * @param {Mixed} actual
113
117
  * @param {Mixed} expected
114
118
  * @param {String} message
119
+ * @namespace Assert
115
120
  * @api public
116
121
  */
117
122
 
@@ -138,6 +143,7 @@ module.exports = function (chai, util) {
138
143
  * @param {Mixed} actual
139
144
  * @param {Mixed} expected
140
145
  * @param {String} message
146
+ * @namespace Assert
141
147
  * @api public
142
148
  */
143
149
 
@@ -164,6 +170,7 @@ module.exports = function (chai, util) {
164
170
  * @param {Mixed} actual
165
171
  * @param {Mixed} expected
166
172
  * @param {String} message
173
+ * @namespace Assert
167
174
  * @api public
168
175
  */
169
176
 
@@ -182,6 +189,7 @@ module.exports = function (chai, util) {
182
189
  * @param {Mixed} actual
183
190
  * @param {Mixed} expected
184
191
  * @param {String} message
192
+ * @namespace Assert
185
193
  * @api public
186
194
  */
187
195
 
@@ -200,6 +208,7 @@ module.exports = function (chai, util) {
200
208
  * @param {Mixed} actual
201
209
  * @param {Mixed} expected
202
210
  * @param {String} message
211
+ * @namespace Assert
203
212
  * @api public
204
213
  */
205
214
 
@@ -218,6 +227,7 @@ module.exports = function (chai, util) {
218
227
  * @param {Mixed} actual
219
228
  * @param {Mixed} expected
220
229
  * @param {String} message
230
+ * @namespace Assert
221
231
  * @api public
222
232
  */
223
233
 
@@ -236,6 +246,7 @@ module.exports = function (chai, util) {
236
246
  * @param {Mixed} valueToCheck
237
247
  * @param {Mixed} valueToBeAbove
238
248
  * @param {String} message
249
+ * @namespace Assert
239
250
  * @api public
240
251
  */
241
252
 
@@ -255,6 +266,7 @@ module.exports = function (chai, util) {
255
266
  * @param {Mixed} valueToCheck
256
267
  * @param {Mixed} valueToBeAtLeast
257
268
  * @param {String} message
269
+ * @namespace Assert
258
270
  * @api public
259
271
  */
260
272
 
@@ -273,6 +285,7 @@ module.exports = function (chai, util) {
273
285
  * @param {Mixed} valueToCheck
274
286
  * @param {Mixed} valueToBeBelow
275
287
  * @param {String} message
288
+ * @namespace Assert
276
289
  * @api public
277
290
  */
278
291
 
@@ -292,6 +305,7 @@ module.exports = function (chai, util) {
292
305
  * @param {Mixed} valueToCheck
293
306
  * @param {Mixed} valueToBeAtMost
294
307
  * @param {String} message
308
+ * @namespace Assert
295
309
  * @api public
296
310
  */
297
311
 
@@ -310,6 +324,7 @@ module.exports = function (chai, util) {
310
324
  * @name isTrue
311
325
  * @param {Mixed} value
312
326
  * @param {String} message
327
+ * @namespace Assert
313
328
  * @api public
314
329
  */
315
330
 
@@ -328,6 +343,7 @@ module.exports = function (chai, util) {
328
343
  * @name isNotTrue
329
344
  * @param {Mixed} value
330
345
  * @param {String} message
346
+ * @namespace Assert
331
347
  * @api public
332
348
  */
333
349
 
@@ -346,6 +362,7 @@ module.exports = function (chai, util) {
346
362
  * @name isFalse
347
363
  * @param {Mixed} value
348
364
  * @param {String} message
365
+ * @namespace Assert
349
366
  * @api public
350
367
  */
351
368
 
@@ -364,6 +381,7 @@ module.exports = function (chai, util) {
364
381
  * @name isNotFalse
365
382
  * @param {Mixed} value
366
383
  * @param {String} message
384
+ * @namespace Assert
367
385
  * @api public
368
386
  */
369
387
 
@@ -381,6 +399,7 @@ module.exports = function (chai, util) {
381
399
  * @name isNull
382
400
  * @param {Mixed} value
383
401
  * @param {String} message
402
+ * @namespace Assert
384
403
  * @api public
385
404
  */
386
405
 
@@ -399,6 +418,7 @@ module.exports = function (chai, util) {
399
418
  * @name isNotNull
400
419
  * @param {Mixed} value
401
420
  * @param {String} message
421
+ * @namespace Assert
402
422
  * @api public
403
423
  */
404
424
 
@@ -415,6 +435,7 @@ module.exports = function (chai, util) {
415
435
  * @name isNaN
416
436
  * @param {Mixed} value
417
437
  * @param {String} message
438
+ * @namespace Assert
418
439
  * @api public
419
440
  */
420
441
 
@@ -431,6 +452,7 @@ module.exports = function (chai, util) {
431
452
  * @name isNotNaN
432
453
  * @param {Mixed} value
433
454
  * @param {String} message
455
+ * @namespace Assert
434
456
  * @api public
435
457
  */
436
458
  assert.isNotNaN = function (val, msg) {
@@ -448,6 +470,7 @@ module.exports = function (chai, util) {
448
470
  * @name isUndefined
449
471
  * @param {Mixed} value
450
472
  * @param {String} message
473
+ * @namespace Assert
451
474
  * @api public
452
475
  */
453
476
 
@@ -466,6 +489,7 @@ module.exports = function (chai, util) {
466
489
  * @name isDefined
467
490
  * @param {Mixed} value
468
491
  * @param {String} message
492
+ * @namespace Assert
469
493
  * @api public
470
494
  */
471
495
 
@@ -484,6 +508,7 @@ module.exports = function (chai, util) {
484
508
  * @name isFunction
485
509
  * @param {Mixed} value
486
510
  * @param {String} message
511
+ * @namespace Assert
487
512
  * @api public
488
513
  */
489
514
 
@@ -502,6 +527,7 @@ module.exports = function (chai, util) {
502
527
  * @name isNotFunction
503
528
  * @param {Mixed} value
504
529
  * @param {String} message
530
+ * @namespace Assert
505
531
  * @api public
506
532
  */
507
533
 
@@ -512,8 +538,8 @@ module.exports = function (chai, util) {
512
538
  /**
513
539
  * ### .isObject(value, [message])
514
540
  *
515
- * Asserts that `value` is an object (as revealed by
516
- * `Object.prototype.toString`).
541
+ * Asserts that `value` is an object of type 'Object' (as revealed by `Object.prototype.toString`).
542
+ * _The assertion does not match subclassed objects._
517
543
  *
518
544
  * var selection = { name: 'Chai', serve: 'with spices' };
519
545
  * assert.isObject(selection, 'tea selection is an object');
@@ -521,6 +547,7 @@ module.exports = function (chai, util) {
521
547
  * @name isObject
522
548
  * @param {Mixed} value
523
549
  * @param {String} message
550
+ * @namespace Assert
524
551
  * @api public
525
552
  */
526
553
 
@@ -531,7 +558,7 @@ module.exports = function (chai, util) {
531
558
  /**
532
559
  * ### .isNotObject(value, [message])
533
560
  *
534
- * Asserts that `value` is _not_ an object.
561
+ * Asserts that `value` is _not_ an object of type 'Object' (as revealed by `Object.prototype.toString`).
535
562
  *
536
563
  * var selection = 'chai'
537
564
  * assert.isNotObject(selection, 'tea selection is not an object');
@@ -540,6 +567,7 @@ module.exports = function (chai, util) {
540
567
  * @name isNotObject
541
568
  * @param {Mixed} value
542
569
  * @param {String} message
570
+ * @namespace Assert
543
571
  * @api public
544
572
  */
545
573
 
@@ -558,6 +586,7 @@ module.exports = function (chai, util) {
558
586
  * @name isArray
559
587
  * @param {Mixed} value
560
588
  * @param {String} message
589
+ * @namespace Assert
561
590
  * @api public
562
591
  */
563
592
 
@@ -576,6 +605,7 @@ module.exports = function (chai, util) {
576
605
  * @name isNotArray
577
606
  * @param {Mixed} value
578
607
  * @param {String} message
608
+ * @namespace Assert
579
609
  * @api public
580
610
  */
581
611
 
@@ -594,6 +624,7 @@ module.exports = function (chai, util) {
594
624
  * @name isString
595
625
  * @param {Mixed} value
596
626
  * @param {String} message
627
+ * @namespace Assert
597
628
  * @api public
598
629
  */
599
630
 
@@ -612,6 +643,7 @@ module.exports = function (chai, util) {
612
643
  * @name isNotString
613
644
  * @param {Mixed} value
614
645
  * @param {String} message
646
+ * @namespace Assert
615
647
  * @api public
616
648
  */
617
649
 
@@ -630,6 +662,7 @@ module.exports = function (chai, util) {
630
662
  * @name isNumber
631
663
  * @param {Number} value
632
664
  * @param {String} message
665
+ * @namespace Assert
633
666
  * @api public
634
667
  */
635
668
 
@@ -648,6 +681,7 @@ module.exports = function (chai, util) {
648
681
  * @name isNotNumber
649
682
  * @param {Mixed} value
650
683
  * @param {String} message
684
+ * @namespace Assert
651
685
  * @api public
652
686
  */
653
687
 
@@ -669,6 +703,7 @@ module.exports = function (chai, util) {
669
703
  * @name isBoolean
670
704
  * @param {Mixed} value
671
705
  * @param {String} message
706
+ * @namespace Assert
672
707
  * @api public
673
708
  */
674
709
 
@@ -690,6 +725,7 @@ module.exports = function (chai, util) {
690
725
  * @name isNotBoolean
691
726
  * @param {Mixed} value
692
727
  * @param {String} message
728
+ * @namespace Assert
693
729
  * @api public
694
730
  */
695
731
 
@@ -714,6 +750,7 @@ module.exports = function (chai, util) {
714
750
  * @param {Mixed} value
715
751
  * @param {String} name
716
752
  * @param {String} message
753
+ * @namespace Assert
717
754
  * @api public
718
755
  */
719
756
 
@@ -733,6 +770,7 @@ module.exports = function (chai, util) {
733
770
  * @param {Mixed} value
734
771
  * @param {String} typeof name
735
772
  * @param {String} message
773
+ * @namespace Assert
736
774
  * @api public
737
775
  */
738
776
 
@@ -754,6 +792,7 @@ module.exports = function (chai, util) {
754
792
  * @param {Object} object
755
793
  * @param {Constructor} constructor
756
794
  * @param {String} message
795
+ * @namespace Assert
757
796
  * @api public
758
797
  */
759
798
 
@@ -775,6 +814,7 @@ module.exports = function (chai, util) {
775
814
  * @param {Object} object
776
815
  * @param {Constructor} constructor
777
816
  * @param {String} message
817
+ * @namespace Assert
778
818
  * @api public
779
819
  */
780
820
 
@@ -795,6 +835,7 @@ module.exports = function (chai, util) {
795
835
  * @param {Array|String} haystack
796
836
  * @param {Mixed} needle
797
837
  * @param {String} message
838
+ * @namespace Assert
798
839
  * @api public
799
840
  */
800
841
 
@@ -815,6 +856,7 @@ module.exports = function (chai, util) {
815
856
  * @param {Array|String} haystack
816
857
  * @param {Mixed} needle
817
858
  * @param {String} message
859
+ * @namespace Assert
818
860
  * @api public
819
861
  */
820
862
 
@@ -833,6 +875,7 @@ module.exports = function (chai, util) {
833
875
  * @param {Mixed} value
834
876
  * @param {RegExp} regexp
835
877
  * @param {String} message
878
+ * @namespace Assert
836
879
  * @api public
837
880
  */
838
881
 
@@ -851,6 +894,7 @@ module.exports = function (chai, util) {
851
894
  * @param {Mixed} value
852
895
  * @param {RegExp} regexp
853
896
  * @param {String} message
897
+ * @namespace Assert
854
898
  * @api public
855
899
  */
856
900
 
@@ -869,6 +913,7 @@ module.exports = function (chai, util) {
869
913
  * @param {Object} object
870
914
  * @param {String} property
871
915
  * @param {String} message
916
+ * @namespace Assert
872
917
  * @api public
873
918
  */
874
919
 
@@ -887,6 +932,7 @@ module.exports = function (chai, util) {
887
932
  * @param {Object} object
888
933
  * @param {String} property
889
934
  * @param {String} message
935
+ * @namespace Assert
890
936
  * @api public
891
937
  */
892
938
 
@@ -906,6 +952,7 @@ module.exports = function (chai, util) {
906
952
  * @param {Object} object
907
953
  * @param {String} property
908
954
  * @param {String} message
955
+ * @namespace Assert
909
956
  * @api public
910
957
  */
911
958
 
@@ -925,6 +972,7 @@ module.exports = function (chai, util) {
925
972
  * @param {Object} object
926
973
  * @param {String} property
927
974
  * @param {String} message
975
+ * @namespace Assert
928
976
  * @api public
929
977
  */
930
978
 
@@ -945,6 +993,7 @@ module.exports = function (chai, util) {
945
993
  * @param {String} property
946
994
  * @param {Mixed} value
947
995
  * @param {String} message
996
+ * @namespace Assert
948
997
  * @api public
949
998
  */
950
999
 
@@ -965,6 +1014,7 @@ module.exports = function (chai, util) {
965
1014
  * @param {String} property
966
1015
  * @param {Mixed} value
967
1016
  * @param {String} message
1017
+ * @namespace Assert
968
1018
  * @api public
969
1019
  */
970
1020
 
@@ -986,6 +1036,7 @@ module.exports = function (chai, util) {
986
1036
  * @param {String} property
987
1037
  * @param {Mixed} value
988
1038
  * @param {String} message
1039
+ * @namespace Assert
989
1040
  * @api public
990
1041
  */
991
1042
 
@@ -1007,6 +1058,7 @@ module.exports = function (chai, util) {
1007
1058
  * @param {String} property
1008
1059
  * @param {Mixed} value
1009
1060
  * @param {String} message
1061
+ * @namespace Assert
1010
1062
  * @api public
1011
1063
  */
1012
1064
 
@@ -1026,6 +1078,7 @@ module.exports = function (chai, util) {
1026
1078
  * @param {Mixed} object
1027
1079
  * @param {Number} length
1028
1080
  * @param {String} message
1081
+ * @namespace Assert
1029
1082
  * @api public
1030
1083
  */
1031
1084
 
@@ -1054,6 +1107,7 @@ module.exports = function (chai, util) {
1054
1107
  * @param {RegExp} regexp
1055
1108
  * @param {String} message
1056
1109
  * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
1110
+ * @namespace Assert
1057
1111
  * @api public
1058
1112
  */
1059
1113
 
@@ -1082,6 +1136,7 @@ module.exports = function (chai, util) {
1082
1136
  * @param {RegExp} regexp
1083
1137
  * @param {String} message
1084
1138
  * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
1139
+ * @namespace Assert
1085
1140
  * @api public
1086
1141
  */
1087
1142
 
@@ -1107,6 +1162,7 @@ module.exports = function (chai, util) {
1107
1162
  * @param {String} operator
1108
1163
  * @param {Mixed} val2
1109
1164
  * @param {String} message
1165
+ * @namespace Assert
1110
1166
  * @api public
1111
1167
  */
1112
1168
 
@@ -1159,6 +1215,7 @@ module.exports = function (chai, util) {
1159
1215
  * @param {Number} expected
1160
1216
  * @param {Number} delta
1161
1217
  * @param {String} message
1218
+ * @namespace Assert
1162
1219
  * @api public
1163
1220
  */
1164
1221
 
@@ -1178,6 +1235,7 @@ module.exports = function (chai, util) {
1178
1235
  * @param {Number} expected
1179
1236
  * @param {Number} delta
1180
1237
  * @param {String} message
1238
+ * @namespace Assert
1181
1239
  * @api public
1182
1240
  */
1183
1241
 
@@ -1197,6 +1255,7 @@ module.exports = function (chai, util) {
1197
1255
  * @param {Array} set1
1198
1256
  * @param {Array} set2
1199
1257
  * @param {String} message
1258
+ * @namespace Assert
1200
1259
  * @api public
1201
1260
  */
1202
1261
 
@@ -1216,6 +1275,7 @@ module.exports = function (chai, util) {
1216
1275
  * @param {Array} set1
1217
1276
  * @param {Array} set2
1218
1277
  * @param {String} message
1278
+ * @namespace Assert
1219
1279
  * @api public
1220
1280
  */
1221
1281
 
@@ -1235,6 +1295,7 @@ module.exports = function (chai, util) {
1235
1295
  * @param {Array} superset
1236
1296
  * @param {Array} subset
1237
1297
  * @param {String} message
1298
+ * @namespace Assert
1238
1299
  * @api public
1239
1300
  */
1240
1301
 
@@ -1242,6 +1303,27 @@ module.exports = function (chai, util) {
1242
1303
  new Assertion(superset, msg).to.include.members(subset);
1243
1304
  }
1244
1305
 
1306
+ /**
1307
+ * ### .includeDeepMembers(superset, subset, [message])
1308
+ *
1309
+ * Asserts that `subset` is included in `superset` - using deep equality checking.
1310
+ * Order is not taken into account.
1311
+ * Duplicates are ignored.
1312
+ *
1313
+ * assert.includeDeepMembers([ {a: 1}, {b: 2}, {c: 3} ], [ {b: 2}, {a: 1}, {b: 2} ], 'include deep members');
1314
+ *
1315
+ * @name includeDeepMembers
1316
+ * @param {Array} superset
1317
+ * @param {Array} subset
1318
+ * @param {String} message
1319
+ * @namespace Assert
1320
+ * @api public
1321
+ */
1322
+
1323
+ assert.includeDeepMembers = function (superset, subset, msg) {
1324
+ new Assertion(superset, msg).to.include.deep.members(subset);
1325
+ }
1326
+
1245
1327
  /**
1246
1328
  * ### .oneOf(inList, list, [message])
1247
1329
  *
@@ -1253,6 +1335,7 @@ module.exports = function (chai, util) {
1253
1335
  * @param {*} inList
1254
1336
  * @param {Array<*>} list
1255
1337
  * @param {String} message
1338
+ * @namespace Assert
1256
1339
  * @api public
1257
1340
  */
1258
1341
 
@@ -1274,6 +1357,7 @@ module.exports = function (chai, util) {
1274
1357
  * @param {Object} object
1275
1358
  * @param {String} property name
1276
1359
  * @param {String} message _optional_
1360
+ * @namespace Assert
1277
1361
  * @api public
1278
1362
  */
1279
1363
 
@@ -1295,6 +1379,7 @@ module.exports = function (chai, util) {
1295
1379
  * @param {Object} object
1296
1380
  * @param {String} property name
1297
1381
  * @param {String} message _optional_
1382
+ * @namespace Assert
1298
1383
  * @api public
1299
1384
  */
1300
1385
 
@@ -1316,6 +1401,7 @@ module.exports = function (chai, util) {
1316
1401
  * @param {Object} object
1317
1402
  * @param {String} property name
1318
1403
  * @param {String} message _optional_
1404
+ * @namespace Assert
1319
1405
  * @api public
1320
1406
  */
1321
1407
 
@@ -1337,6 +1423,7 @@ module.exports = function (chai, util) {
1337
1423
  * @param {Object} object
1338
1424
  * @param {String} property name
1339
1425
  * @param {String} message _optional_
1426
+ * @namespace Assert
1340
1427
  * @api public
1341
1428
  */
1342
1429
 
@@ -1358,6 +1445,7 @@ module.exports = function (chai, util) {
1358
1445
  * @param {Object} object
1359
1446
  * @param {String} property name
1360
1447
  * @param {String} message _optional_
1448
+ * @namespace Assert
1361
1449
  * @api public
1362
1450
  */
1363
1451
 
@@ -1379,6 +1467,7 @@ module.exports = function (chai, util) {
1379
1467
  * @param {Object} object
1380
1468
  * @param {String} property name
1381
1469
  * @param {String} message _optional_
1470
+ * @namespace Assert
1382
1471
  * @api public
1383
1472
  */
1384
1473
 
@@ -1398,6 +1487,7 @@ module.exports = function (chai, util) {
1398
1487
  *
1399
1488
  * @name ifError
1400
1489
  * @param {Object} object
1490
+ * @namespace Assert
1401
1491
  * @api public
1402
1492
  */
1403
1493
 
@@ -1418,6 +1508,7 @@ module.exports = function (chai, util) {
1418
1508
  * @alias extensible
1419
1509
  * @param {Object} object
1420
1510
  * @param {String} message _optional_
1511
+ * @namespace Assert
1421
1512
  * @api public
1422
1513
  */
1423
1514
 
@@ -1442,6 +1533,7 @@ module.exports = function (chai, util) {
1442
1533
  * @alias notExtensible
1443
1534
  * @param {Object} object
1444
1535
  * @param {String} message _optional_
1536
+ * @namespace Assert
1445
1537
  * @api public
1446
1538
  */
1447
1539
 
@@ -1465,6 +1557,7 @@ module.exports = function (chai, util) {
1465
1557
  * @alias sealed
1466
1558
  * @param {Object} object
1467
1559
  * @param {String} message _optional_
1560
+ * @namespace Assert
1468
1561
  * @api public
1469
1562
  */
1470
1563
 
@@ -1483,6 +1576,7 @@ module.exports = function (chai, util) {
1483
1576
  * @alias notSealed
1484
1577
  * @param {Object} object
1485
1578
  * @param {String} message _optional_
1579
+ * @namespace Assert
1486
1580
  * @api public
1487
1581
  */
1488
1582
 
@@ -1503,6 +1597,7 @@ module.exports = function (chai, util) {
1503
1597
  * @alias frozen
1504
1598
  * @param {Object} object
1505
1599
  * @param {String} message _optional_
1600
+ * @namespace Assert
1506
1601
  * @api public
1507
1602
  */
1508
1603
 
@@ -1521,6 +1616,7 @@ module.exports = function (chai, util) {
1521
1616
  * @alias notFrozen
1522
1617
  * @param {Object} object
1523
1618
  * @param {String} message _optional_
1619
+ * @namespace Assert
1524
1620
  * @api public
1525
1621
  */
1526
1622
 
@@ -19,6 +19,7 @@ module.exports = function (chai, util) {
19
19
  * @param {Mixed} expected
20
20
  * @param {String} message
21
21
  * @param {String} operator
22
+ * @namespace Expect
22
23
  * @api public
23
24
  */
24
25