chai 5.0.2 → 5.1.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.
- package/chai.js +3992 -0
- package/lib/chai/assertion.js +2 -3
- package/lib/chai/core/assertions.js +38 -4
- package/lib/chai/interface/assert.js +250 -355
- package/lib/chai/interface/expect.js +5 -5
- package/lib/chai/interface/should.js +13 -20
- package/lib/chai/utils/addChainableMethod.js +1 -5
- package/lib/chai/utils/compareByInspect.js +0 -4
- package/lib/chai/utils/getMessage.js +0 -4
- package/lib/chai/utils/getOwnEnumerableProperties.js +0 -4
- package/lib/chai/utils/index.js +28 -111
- package/lib/chai/utils/objDisplay.js +0 -4
- package/lib/chai/utils/test.js +0 -4
- package/lib/chai.js +7 -29
- package/package.json +1 -1
|
@@ -8,7 +8,6 @@ import * as chai from '../../../index.js';
|
|
|
8
8
|
import {Assertion} from '../assertion.js';
|
|
9
9
|
import {flag, inspect} from '../utils/index.js';
|
|
10
10
|
import {AssertionError} from 'assertion-error';
|
|
11
|
-
import {type} from '../utils/type-detect.js';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* ### assert(expression, message)
|
|
@@ -18,13 +17,12 @@ import {type} from '../utils/type-detect.js';
|
|
|
18
17
|
* assert('foo' !== 'bar', 'foo is not bar');
|
|
19
18
|
* assert(Array.isArray([]), 'empty arrays are arrays');
|
|
20
19
|
*
|
|
21
|
-
* @param {
|
|
20
|
+
* @param {unknown} expression to test for truthiness
|
|
22
21
|
* @param {String} message to display on error
|
|
23
22
|
* @name assert
|
|
24
23
|
* @namespace Assert
|
|
25
|
-
* @
|
|
24
|
+
* @public
|
|
26
25
|
*/
|
|
27
|
-
|
|
28
26
|
function assert(express, errmsg) {
|
|
29
27
|
var test = new Assertion(null, null, chai.assert, true);
|
|
30
28
|
test.assert(
|
|
@@ -50,14 +48,13 @@ export {assert};
|
|
|
50
48
|
* assert.fail(1, 2, undefined, ">");
|
|
51
49
|
*
|
|
52
50
|
* @name fail
|
|
53
|
-
* @param {
|
|
54
|
-
* @param {
|
|
51
|
+
* @param {unknown} actual
|
|
52
|
+
* @param {unknown} expected
|
|
55
53
|
* @param {String} message
|
|
56
54
|
* @param {String} operator
|
|
57
55
|
* @namespace Assert
|
|
58
|
-
* @
|
|
56
|
+
* @public
|
|
59
57
|
*/
|
|
60
|
-
|
|
61
58
|
assert.fail = function (actual, expected, message, operator) {
|
|
62
59
|
if (arguments.length < 2) {
|
|
63
60
|
// Comply with Node's fail([message]) interface
|
|
@@ -84,12 +81,11 @@ assert.fail = function (actual, expected, message, operator) {
|
|
|
84
81
|
*
|
|
85
82
|
* @name isOk
|
|
86
83
|
* @alias ok
|
|
87
|
-
* @param {
|
|
84
|
+
* @param {unknown} object to test
|
|
88
85
|
* @param {String} message
|
|
89
86
|
* @namespace Assert
|
|
90
|
-
* @
|
|
87
|
+
* @public
|
|
91
88
|
*/
|
|
92
|
-
|
|
93
89
|
assert.isOk = function (val, msg) {
|
|
94
90
|
new Assertion(val, msg, assert.isOk, true).is.ok;
|
|
95
91
|
};
|
|
@@ -104,12 +100,11 @@ assert.isOk = function (val, msg) {
|
|
|
104
100
|
*
|
|
105
101
|
* @name isNotOk
|
|
106
102
|
* @alias notOk
|
|
107
|
-
* @param {
|
|
103
|
+
* @param {unknown} object to test
|
|
108
104
|
* @param {String} message
|
|
109
105
|
* @namespace Assert
|
|
110
|
-
* @
|
|
106
|
+
* @public
|
|
111
107
|
*/
|
|
112
|
-
|
|
113
108
|
assert.isNotOk = function (val, msg) {
|
|
114
109
|
new Assertion(val, msg, assert.isNotOk, true).is.not.ok;
|
|
115
110
|
};
|
|
@@ -122,13 +117,12 @@ assert.isNotOk = function (val, msg) {
|
|
|
122
117
|
* assert.equal(3, '3', '== coerces values to strings');
|
|
123
118
|
*
|
|
124
119
|
* @name equal
|
|
125
|
-
* @param {
|
|
126
|
-
* @param {
|
|
120
|
+
* @param {unknown} actual
|
|
121
|
+
* @param {unknown} expected
|
|
127
122
|
* @param {String} message
|
|
128
123
|
* @namespace Assert
|
|
129
|
-
* @
|
|
124
|
+
* @public
|
|
130
125
|
*/
|
|
131
|
-
|
|
132
126
|
assert.equal = function (act, exp, msg) {
|
|
133
127
|
var test = new Assertion(act, msg, assert.equal, true);
|
|
134
128
|
|
|
@@ -150,13 +144,12 @@ assert.equal = function (act, exp, msg) {
|
|
|
150
144
|
* assert.notEqual(3, 4, 'these numbers are not equal');
|
|
151
145
|
*
|
|
152
146
|
* @name notEqual
|
|
153
|
-
* @param {
|
|
154
|
-
* @param {
|
|
147
|
+
* @param {unknown} actual
|
|
148
|
+
* @param {unknown} expected
|
|
155
149
|
* @param {String} message
|
|
156
150
|
* @namespace Assert
|
|
157
|
-
* @
|
|
151
|
+
* @public
|
|
158
152
|
*/
|
|
159
|
-
|
|
160
153
|
assert.notEqual = function (act, exp, msg) {
|
|
161
154
|
var test = new Assertion(act, msg, assert.notEqual, true);
|
|
162
155
|
|
|
@@ -178,13 +171,12 @@ assert.notEqual = function (act, exp, msg) {
|
|
|
178
171
|
* assert.strictEqual(true, true, 'these booleans are strictly equal');
|
|
179
172
|
*
|
|
180
173
|
* @name strictEqual
|
|
181
|
-
* @param {
|
|
182
|
-
* @param {
|
|
174
|
+
* @param {unknown} actual
|
|
175
|
+
* @param {unknown} expected
|
|
183
176
|
* @param {String} message
|
|
184
177
|
* @namespace Assert
|
|
185
|
-
* @
|
|
178
|
+
* @public
|
|
186
179
|
*/
|
|
187
|
-
|
|
188
180
|
assert.strictEqual = function (act, exp, msg) {
|
|
189
181
|
new Assertion(act, msg, assert.strictEqual, true).to.equal(exp);
|
|
190
182
|
};
|
|
@@ -197,13 +189,12 @@ assert.strictEqual = function (act, exp, msg) {
|
|
|
197
189
|
* assert.notStrictEqual(3, '3', 'no coercion for strict equality');
|
|
198
190
|
*
|
|
199
191
|
* @name notStrictEqual
|
|
200
|
-
* @param {
|
|
201
|
-
* @param {
|
|
192
|
+
* @param {unknown} actual
|
|
193
|
+
* @param {unknown} expected
|
|
202
194
|
* @param {String} message
|
|
203
195
|
* @namespace Assert
|
|
204
|
-
* @
|
|
196
|
+
* @public
|
|
205
197
|
*/
|
|
206
|
-
|
|
207
198
|
assert.notStrictEqual = function (act, exp, msg) {
|
|
208
199
|
new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp);
|
|
209
200
|
};
|
|
@@ -216,14 +207,13 @@ assert.notStrictEqual = function (act, exp, msg) {
|
|
|
216
207
|
* assert.deepEqual({ tea: 'green' }, { tea: 'green' });
|
|
217
208
|
*
|
|
218
209
|
* @name deepEqual
|
|
219
|
-
* @param {
|
|
220
|
-
* @param {
|
|
210
|
+
* @param {unknown} actual
|
|
211
|
+
* @param {unknown} expected
|
|
221
212
|
* @param {String} message
|
|
222
213
|
* @alias deepStrictEqual
|
|
223
214
|
* @namespace Assert
|
|
224
|
-
* @
|
|
215
|
+
* @public
|
|
225
216
|
*/
|
|
226
|
-
|
|
227
217
|
assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) {
|
|
228
218
|
new Assertion(act, msg, assert.deepEqual, true).to.eql(exp);
|
|
229
219
|
};
|
|
@@ -236,13 +226,12 @@ assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) {
|
|
|
236
226
|
* assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
|
|
237
227
|
*
|
|
238
228
|
* @name notDeepEqual
|
|
239
|
-
* @param {
|
|
240
|
-
* @param {
|
|
229
|
+
* @param {unknown} actual
|
|
230
|
+
* @param {unknown} expected
|
|
241
231
|
* @param {String} message
|
|
242
232
|
* @namespace Assert
|
|
243
|
-
* @
|
|
233
|
+
* @public
|
|
244
234
|
*/
|
|
245
|
-
|
|
246
235
|
assert.notDeepEqual = function (act, exp, msg) {
|
|
247
236
|
new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp);
|
|
248
237
|
};
|
|
@@ -255,13 +244,12 @@ assert.notDeepEqual = function (act, exp, msg) {
|
|
|
255
244
|
* assert.isAbove(5, 2, '5 is strictly greater than 2');
|
|
256
245
|
*
|
|
257
246
|
* @name isAbove
|
|
258
|
-
* @param {
|
|
259
|
-
* @param {
|
|
247
|
+
* @param {unknown} valueToCheck
|
|
248
|
+
* @param {unknown} valueToBeAbove
|
|
260
249
|
* @param {String} message
|
|
261
250
|
* @namespace Assert
|
|
262
|
-
* @
|
|
251
|
+
* @public
|
|
263
252
|
*/
|
|
264
|
-
|
|
265
253
|
assert.isAbove = function (val, abv, msg) {
|
|
266
254
|
new Assertion(val, msg, assert.isAbove, true).to.be.above(abv);
|
|
267
255
|
};
|
|
@@ -275,13 +263,12 @@ assert.isAbove = function (val, abv, msg) {
|
|
|
275
263
|
* assert.isAtLeast(3, 3, '3 is greater or equal to 3');
|
|
276
264
|
*
|
|
277
265
|
* @name isAtLeast
|
|
278
|
-
* @param {
|
|
279
|
-
* @param {
|
|
266
|
+
* @param {unknown} valueToCheck
|
|
267
|
+
* @param {unknown} valueToBeAtLeast
|
|
280
268
|
* @param {String} message
|
|
281
269
|
* @namespace Assert
|
|
282
|
-
* @
|
|
270
|
+
* @public
|
|
283
271
|
*/
|
|
284
|
-
|
|
285
272
|
assert.isAtLeast = function (val, atlst, msg) {
|
|
286
273
|
new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst);
|
|
287
274
|
};
|
|
@@ -294,13 +281,12 @@ assert.isAtLeast = function (val, atlst, msg) {
|
|
|
294
281
|
* assert.isBelow(3, 6, '3 is strictly less than 6');
|
|
295
282
|
*
|
|
296
283
|
* @name isBelow
|
|
297
|
-
* @param {
|
|
298
|
-
* @param {
|
|
284
|
+
* @param {unknown} valueToCheck
|
|
285
|
+
* @param {unknown} valueToBeBelow
|
|
299
286
|
* @param {String} message
|
|
300
287
|
* @namespace Assert
|
|
301
|
-
* @
|
|
288
|
+
* @public
|
|
302
289
|
*/
|
|
303
|
-
|
|
304
290
|
assert.isBelow = function (val, blw, msg) {
|
|
305
291
|
new Assertion(val, msg, assert.isBelow, true).to.be.below(blw);
|
|
306
292
|
};
|
|
@@ -314,13 +300,12 @@ assert.isBelow = function (val, blw, msg) {
|
|
|
314
300
|
* assert.isAtMost(4, 4, '4 is less than or equal to 4');
|
|
315
301
|
*
|
|
316
302
|
* @name isAtMost
|
|
317
|
-
* @param {
|
|
318
|
-
* @param {
|
|
303
|
+
* @param {unknown} valueToCheck
|
|
304
|
+
* @param {unknown} valueToBeAtMost
|
|
319
305
|
* @param {String} message
|
|
320
306
|
* @namespace Assert
|
|
321
|
-
* @
|
|
307
|
+
* @public
|
|
322
308
|
*/
|
|
323
|
-
|
|
324
309
|
assert.isAtMost = function (val, atmst, msg) {
|
|
325
310
|
new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst);
|
|
326
311
|
};
|
|
@@ -334,12 +319,11 @@ assert.isAtMost = function (val, atmst, msg) {
|
|
|
334
319
|
* assert.isTrue(teaServed, 'the tea has been served');
|
|
335
320
|
*
|
|
336
321
|
* @name isTrue
|
|
337
|
-
* @param {
|
|
322
|
+
* @param {unknown} value
|
|
338
323
|
* @param {String} message
|
|
339
324
|
* @namespace Assert
|
|
340
|
-
* @
|
|
325
|
+
* @public
|
|
341
326
|
*/
|
|
342
|
-
|
|
343
327
|
assert.isTrue = function (val, msg) {
|
|
344
328
|
new Assertion(val, msg, assert.isTrue, true).is['true'];
|
|
345
329
|
};
|
|
@@ -353,12 +337,11 @@ assert.isTrue = function (val, msg) {
|
|
|
353
337
|
* assert.isNotTrue(tea, 'great, time for tea!');
|
|
354
338
|
*
|
|
355
339
|
* @name isNotTrue
|
|
356
|
-
* @param {
|
|
340
|
+
* @param {unknown} value
|
|
357
341
|
* @param {String} message
|
|
358
342
|
* @namespace Assert
|
|
359
|
-
* @
|
|
343
|
+
* @public
|
|
360
344
|
*/
|
|
361
|
-
|
|
362
345
|
assert.isNotTrue = function (val, msg) {
|
|
363
346
|
new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true);
|
|
364
347
|
};
|
|
@@ -372,12 +355,11 @@ assert.isNotTrue = function (val, msg) {
|
|
|
372
355
|
* assert.isFalse(teaServed, 'no tea yet? hmm...');
|
|
373
356
|
*
|
|
374
357
|
* @name isFalse
|
|
375
|
-
* @param {
|
|
358
|
+
* @param {unknown} value
|
|
376
359
|
* @param {String} message
|
|
377
360
|
* @namespace Assert
|
|
378
|
-
* @
|
|
361
|
+
* @public
|
|
379
362
|
*/
|
|
380
|
-
|
|
381
363
|
assert.isFalse = function (val, msg) {
|
|
382
364
|
new Assertion(val, msg, assert.isFalse, true).is['false'];
|
|
383
365
|
};
|
|
@@ -391,12 +373,11 @@ assert.isFalse = function (val, msg) {
|
|
|
391
373
|
* assert.isNotFalse(tea, 'great, time for tea!');
|
|
392
374
|
*
|
|
393
375
|
* @name isNotFalse
|
|
394
|
-
* @param {
|
|
376
|
+
* @param {unknown} value
|
|
395
377
|
* @param {String} message
|
|
396
378
|
* @namespace Assert
|
|
397
|
-
* @
|
|
379
|
+
* @public
|
|
398
380
|
*/
|
|
399
|
-
|
|
400
381
|
assert.isNotFalse = function (val, msg) {
|
|
401
382
|
new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false);
|
|
402
383
|
};
|
|
@@ -409,12 +390,11 @@ assert.isNotFalse = function (val, msg) {
|
|
|
409
390
|
* assert.isNull(err, 'there was no error');
|
|
410
391
|
*
|
|
411
392
|
* @name isNull
|
|
412
|
-
* @param {
|
|
393
|
+
* @param {unknown} value
|
|
413
394
|
* @param {String} message
|
|
414
395
|
* @namespace Assert
|
|
415
|
-
* @
|
|
396
|
+
* @public
|
|
416
397
|
*/
|
|
417
|
-
|
|
418
398
|
assert.isNull = function (val, msg) {
|
|
419
399
|
new Assertion(val, msg, assert.isNull, true).to.equal(null);
|
|
420
400
|
};
|
|
@@ -428,12 +408,11 @@ assert.isNull = function (val, msg) {
|
|
|
428
408
|
* assert.isNotNull(tea, 'great, time for tea!');
|
|
429
409
|
*
|
|
430
410
|
* @name isNotNull
|
|
431
|
-
* @param {
|
|
411
|
+
* @param {unknown} value
|
|
432
412
|
* @param {String} message
|
|
433
413
|
* @namespace Assert
|
|
434
|
-
* @
|
|
414
|
+
* @public
|
|
435
415
|
*/
|
|
436
|
-
|
|
437
416
|
assert.isNotNull = function (val, msg) {
|
|
438
417
|
new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null);
|
|
439
418
|
};
|
|
@@ -446,12 +425,11 @@ assert.isNotNull = function (val, msg) {
|
|
|
446
425
|
* assert.isNaN(NaN, 'NaN is NaN');
|
|
447
426
|
*
|
|
448
427
|
* @name isNaN
|
|
449
|
-
* @param {
|
|
428
|
+
* @param {unknown} value
|
|
450
429
|
* @param {String} message
|
|
451
430
|
* @namespace Assert
|
|
452
|
-
* @
|
|
431
|
+
* @public
|
|
453
432
|
*/
|
|
454
|
-
|
|
455
433
|
assert.isNaN = function (val, msg) {
|
|
456
434
|
new Assertion(val, msg, assert.isNaN, true).to.be.NaN;
|
|
457
435
|
};
|
|
@@ -464,12 +442,11 @@ assert.isNaN = function (val, msg) {
|
|
|
464
442
|
* assert.isNotNaN(4, '4 is not NaN');
|
|
465
443
|
*
|
|
466
444
|
* @name isNotNaN
|
|
467
|
-
* @param {
|
|
445
|
+
* @param {unknown} value
|
|
468
446
|
* @param {String} message
|
|
469
447
|
* @namespace Assert
|
|
470
|
-
* @
|
|
471
|
-
*/
|
|
472
|
-
assert.isNotNaN = function (val, msg) {
|
|
448
|
+
* @public
|
|
449
|
+
*/assert.isNotNaN = function (val, msg) {
|
|
473
450
|
new Assertion(val, msg, assert.isNotNaN, true).not.to.be.NaN;
|
|
474
451
|
};
|
|
475
452
|
|
|
@@ -483,12 +460,11 @@ assert.isNotNaN = function (val, msg) {
|
|
|
483
460
|
* assert.exists(foo, 'foo is neither `null` nor `undefined`');
|
|
484
461
|
*
|
|
485
462
|
* @name exists
|
|
486
|
-
* @param {
|
|
463
|
+
* @param {unknown} value
|
|
487
464
|
* @param {String} message
|
|
488
465
|
* @namespace Assert
|
|
489
|
-
* @
|
|
466
|
+
* @public
|
|
490
467
|
*/
|
|
491
|
-
|
|
492
468
|
assert.exists = function (val, msg) {
|
|
493
469
|
new Assertion(val, msg, assert.exists, true).to.exist;
|
|
494
470
|
};
|
|
@@ -505,12 +481,11 @@ assert.exists = function (val, msg) {
|
|
|
505
481
|
* assert.notExists(baz, 'baz is either null or undefined');
|
|
506
482
|
*
|
|
507
483
|
* @name notExists
|
|
508
|
-
* @param {
|
|
484
|
+
* @param {unknown} value
|
|
509
485
|
* @param {String} message
|
|
510
486
|
* @namespace Assert
|
|
511
|
-
* @
|
|
487
|
+
* @public
|
|
512
488
|
*/
|
|
513
|
-
|
|
514
489
|
assert.notExists = function (val, msg) {
|
|
515
490
|
new Assertion(val, msg, assert.notExists, true).to.not.exist;
|
|
516
491
|
};
|
|
@@ -524,12 +499,11 @@ assert.notExists = function (val, msg) {
|
|
|
524
499
|
* assert.isUndefined(tea, 'no tea defined');
|
|
525
500
|
*
|
|
526
501
|
* @name isUndefined
|
|
527
|
-
* @param {
|
|
502
|
+
* @param {unknown} value
|
|
528
503
|
* @param {String} message
|
|
529
504
|
* @namespace Assert
|
|
530
|
-
* @
|
|
505
|
+
* @public
|
|
531
506
|
*/
|
|
532
|
-
|
|
533
507
|
assert.isUndefined = function (val, msg) {
|
|
534
508
|
new Assertion(val, msg, assert.isUndefined, true).to.equal(undefined);
|
|
535
509
|
};
|
|
@@ -543,12 +517,11 @@ assert.isUndefined = function (val, msg) {
|
|
|
543
517
|
* assert.isDefined(tea, 'tea has been defined');
|
|
544
518
|
*
|
|
545
519
|
* @name isDefined
|
|
546
|
-
* @param {
|
|
520
|
+
* @param {unknown} value
|
|
547
521
|
* @param {String} message
|
|
548
522
|
* @namespace Assert
|
|
549
|
-
* @
|
|
523
|
+
* @public
|
|
550
524
|
*/
|
|
551
|
-
|
|
552
525
|
assert.isDefined = function (val, msg) {
|
|
553
526
|
new Assertion(val, msg, assert.isDefined, true).to.not.equal(undefined);
|
|
554
527
|
};
|
|
@@ -562,12 +535,11 @@ assert.isDefined = function (val, msg) {
|
|
|
562
535
|
* assert.isCallable(serveTea, 'great, we can have tea now');
|
|
563
536
|
*
|
|
564
537
|
* @name isCallable
|
|
565
|
-
* @param {
|
|
538
|
+
* @param {unknown} value
|
|
566
539
|
* @param {String} message
|
|
567
540
|
* @namespace Assert
|
|
568
|
-
* @
|
|
569
|
-
*/
|
|
570
|
-
assert.isCallable = function (val, msg) {
|
|
541
|
+
* @public
|
|
542
|
+
*/assert.isCallable = function (val, msg) {
|
|
571
543
|
new Assertion(val, msg, assert.isCallable, true).is.callable;
|
|
572
544
|
}
|
|
573
545
|
|
|
@@ -580,12 +552,11 @@ assert.isCallable = function (val, msg) {
|
|
|
580
552
|
* assert.isNotCallable(serveTea, 'great, we have listed the steps');
|
|
581
553
|
*
|
|
582
554
|
* @name isNotCallable
|
|
583
|
-
* @param {
|
|
555
|
+
* @param {unknown} value
|
|
584
556
|
* @param {String} message
|
|
585
557
|
* @namespace Assert
|
|
586
|
-
* @
|
|
587
|
-
*/
|
|
588
|
-
assert.isNotCallable = function (val, msg) {
|
|
558
|
+
* @public
|
|
559
|
+
*/assert.isNotCallable = function (val, msg) {
|
|
589
560
|
new Assertion(val, msg, assert.isNotCallable, true).is.not.callable;
|
|
590
561
|
};
|
|
591
562
|
|
|
@@ -599,12 +570,11 @@ assert.isNotCallable = function (val, msg) {
|
|
|
599
570
|
* assert.isObject(selection, 'tea selection is an object');
|
|
600
571
|
*
|
|
601
572
|
* @name isObject
|
|
602
|
-
* @param {
|
|
573
|
+
* @param {unknown} value
|
|
603
574
|
* @param {String} message
|
|
604
575
|
* @namespace Assert
|
|
605
|
-
* @
|
|
576
|
+
* @public
|
|
606
577
|
*/
|
|
607
|
-
|
|
608
578
|
assert.isObject = function (val, msg) {
|
|
609
579
|
new Assertion(val, msg, assert.isObject, true).to.be.a('object');
|
|
610
580
|
};
|
|
@@ -619,12 +589,11 @@ assert.isObject = function (val, msg) {
|
|
|
619
589
|
* assert.isNotObject(null, 'null is not an object');
|
|
620
590
|
*
|
|
621
591
|
* @name isNotObject
|
|
622
|
-
* @param {
|
|
592
|
+
* @param {unknown} value
|
|
623
593
|
* @param {String} message
|
|
624
594
|
* @namespace Assert
|
|
625
|
-
* @
|
|
595
|
+
* @public
|
|
626
596
|
*/
|
|
627
|
-
|
|
628
597
|
assert.isNotObject = function (val, msg) {
|
|
629
598
|
new Assertion(val, msg, assert.isNotObject, true).to.not.be.a('object');
|
|
630
599
|
};
|
|
@@ -638,12 +607,11 @@ assert.isNotObject = function (val, msg) {
|
|
|
638
607
|
* assert.isArray(menu, 'what kind of tea do we want?');
|
|
639
608
|
*
|
|
640
609
|
* @name isArray
|
|
641
|
-
* @param {
|
|
610
|
+
* @param {unknown} value
|
|
642
611
|
* @param {String} message
|
|
643
612
|
* @namespace Assert
|
|
644
|
-
* @
|
|
613
|
+
* @public
|
|
645
614
|
*/
|
|
646
|
-
|
|
647
615
|
assert.isArray = function (val, msg) {
|
|
648
616
|
new Assertion(val, msg, assert.isArray, true).to.be.an('array');
|
|
649
617
|
};
|
|
@@ -657,12 +625,11 @@ assert.isArray = function (val, msg) {
|
|
|
657
625
|
* assert.isNotArray(menu, 'what kind of tea do we want?');
|
|
658
626
|
*
|
|
659
627
|
* @name isNotArray
|
|
660
|
-
* @param {
|
|
628
|
+
* @param {unknown} value
|
|
661
629
|
* @param {String} message
|
|
662
630
|
* @namespace Assert
|
|
663
|
-
* @
|
|
631
|
+
* @public
|
|
664
632
|
*/
|
|
665
|
-
|
|
666
633
|
assert.isNotArray = function (val, msg) {
|
|
667
634
|
new Assertion(val, msg, assert.isNotArray, true).to.not.be.an('array');
|
|
668
635
|
};
|
|
@@ -676,12 +643,11 @@ assert.isNotArray = function (val, msg) {
|
|
|
676
643
|
* assert.isString(teaOrder, 'order placed');
|
|
677
644
|
*
|
|
678
645
|
* @name isString
|
|
679
|
-
* @param {
|
|
646
|
+
* @param {unknown} value
|
|
680
647
|
* @param {String} message
|
|
681
648
|
* @namespace Assert
|
|
682
|
-
* @
|
|
649
|
+
* @public
|
|
683
650
|
*/
|
|
684
|
-
|
|
685
651
|
assert.isString = function (val, msg) {
|
|
686
652
|
new Assertion(val, msg, assert.isString, true).to.be.a('string');
|
|
687
653
|
};
|
|
@@ -695,12 +661,11 @@ assert.isString = function (val, msg) {
|
|
|
695
661
|
* assert.isNotString(teaOrder, 'order placed');
|
|
696
662
|
*
|
|
697
663
|
* @name isNotString
|
|
698
|
-
* @param {
|
|
664
|
+
* @param {unknown} value
|
|
699
665
|
* @param {String} message
|
|
700
666
|
* @namespace Assert
|
|
701
|
-
* @
|
|
667
|
+
* @public
|
|
702
668
|
*/
|
|
703
|
-
|
|
704
669
|
assert.isNotString = function (val, msg) {
|
|
705
670
|
new Assertion(val, msg, assert.isNotString, true).to.not.be.a('string');
|
|
706
671
|
};
|
|
@@ -717,9 +682,8 @@ assert.isNotString = function (val, msg) {
|
|
|
717
682
|
* @param {Number} value
|
|
718
683
|
* @param {String} message
|
|
719
684
|
* @namespace Assert
|
|
720
|
-
* @
|
|
685
|
+
* @public
|
|
721
686
|
*/
|
|
722
|
-
|
|
723
687
|
assert.isNumber = function (val, msg) {
|
|
724
688
|
new Assertion(val, msg, assert.isNumber, true).to.be.a('number');
|
|
725
689
|
};
|
|
@@ -733,12 +697,11 @@ assert.isNumber = function (val, msg) {
|
|
|
733
697
|
* assert.isNotNumber(cups, 'how many cups');
|
|
734
698
|
*
|
|
735
699
|
* @name isNotNumber
|
|
736
|
-
* @param {
|
|
700
|
+
* @param {unknown} value
|
|
737
701
|
* @param {String} message
|
|
738
702
|
* @namespace Assert
|
|
739
|
-
* @
|
|
703
|
+
* @public
|
|
740
704
|
*/
|
|
741
|
-
|
|
742
705
|
assert.isNotNumber = function (val, msg) {
|
|
743
706
|
new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a('number');
|
|
744
707
|
};
|
|
@@ -757,9 +720,8 @@ assert.isNotNumber = function (val, msg) {
|
|
|
757
720
|
* @param {Number} value
|
|
758
721
|
* @param {String} message
|
|
759
722
|
* @namespace Assert
|
|
760
|
-
* @
|
|
723
|
+
* @public
|
|
761
724
|
*/
|
|
762
|
-
|
|
763
725
|
assert.isFinite = function (val, msg) {
|
|
764
726
|
new Assertion(val, msg, assert.isFinite, true).to.be.finite;
|
|
765
727
|
};
|
|
@@ -776,12 +738,11 @@ assert.isFinite = function (val, msg) {
|
|
|
776
738
|
* assert.isBoolean(teaServed, 'has tea been served');
|
|
777
739
|
*
|
|
778
740
|
* @name isBoolean
|
|
779
|
-
* @param {
|
|
741
|
+
* @param {unknown} value
|
|
780
742
|
* @param {String} message
|
|
781
743
|
* @namespace Assert
|
|
782
|
-
* @
|
|
744
|
+
* @public
|
|
783
745
|
*/
|
|
784
|
-
|
|
785
746
|
assert.isBoolean = function (val, msg) {
|
|
786
747
|
new Assertion(val, msg, assert.isBoolean, true).to.be.a('boolean');
|
|
787
748
|
};
|
|
@@ -798,12 +759,11 @@ assert.isBoolean = function (val, msg) {
|
|
|
798
759
|
* assert.isNotBoolean(teaServed, 'has tea been served');
|
|
799
760
|
*
|
|
800
761
|
* @name isNotBoolean
|
|
801
|
-
* @param {
|
|
762
|
+
* @param {unknown} value
|
|
802
763
|
* @param {String} message
|
|
803
764
|
* @namespace Assert
|
|
804
|
-
* @
|
|
765
|
+
* @public
|
|
805
766
|
*/
|
|
806
|
-
|
|
807
767
|
assert.isNotBoolean = function (val, msg) {
|
|
808
768
|
new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a('boolean');
|
|
809
769
|
};
|
|
@@ -822,13 +782,12 @@ assert.isNotBoolean = function (val, msg) {
|
|
|
822
782
|
* assert.typeOf(undefined, 'undefined', 'we have an undefined');
|
|
823
783
|
*
|
|
824
784
|
* @name typeOf
|
|
825
|
-
* @param {
|
|
785
|
+
* @param {unknown} value
|
|
826
786
|
* @param {String} name
|
|
827
787
|
* @param {String} message
|
|
828
788
|
* @namespace Assert
|
|
829
|
-
* @
|
|
789
|
+
* @public
|
|
830
790
|
*/
|
|
831
|
-
|
|
832
791
|
assert.typeOf = function (val, type, msg) {
|
|
833
792
|
new Assertion(val, msg, assert.typeOf, true).to.be.a(type);
|
|
834
793
|
};
|
|
@@ -842,13 +801,12 @@ assert.typeOf = function (val, type, msg) {
|
|
|
842
801
|
* assert.notTypeOf('tea', 'number', 'strings are not numbers');
|
|
843
802
|
*
|
|
844
803
|
* @name notTypeOf
|
|
845
|
-
* @param {
|
|
804
|
+
* @param {unknown} value
|
|
846
805
|
* @param {String} typeof name
|
|
847
806
|
* @param {String} message
|
|
848
807
|
* @namespace Assert
|
|
849
|
-
* @
|
|
808
|
+
* @public
|
|
850
809
|
*/
|
|
851
|
-
|
|
852
810
|
assert.notTypeOf = function (val, type, msg) {
|
|
853
811
|
new Assertion(val, msg, assert.notTypeOf, true).to.not.be.a(type);
|
|
854
812
|
};
|
|
@@ -868,9 +826,8 @@ assert.notTypeOf = function (val, type, msg) {
|
|
|
868
826
|
* @param {Constructor} constructor
|
|
869
827
|
* @param {String} message
|
|
870
828
|
* @namespace Assert
|
|
871
|
-
* @
|
|
829
|
+
* @public
|
|
872
830
|
*/
|
|
873
|
-
|
|
874
831
|
assert.instanceOf = function (val, type, msg) {
|
|
875
832
|
new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type);
|
|
876
833
|
};
|
|
@@ -890,9 +847,8 @@ assert.instanceOf = function (val, type, msg) {
|
|
|
890
847
|
* @param {Constructor} constructor
|
|
891
848
|
* @param {String} message
|
|
892
849
|
* @namespace Assert
|
|
893
|
-
* @
|
|
850
|
+
* @public
|
|
894
851
|
*/
|
|
895
|
-
|
|
896
852
|
assert.notInstanceOf = function (val, type, msg) {
|
|
897
853
|
new Assertion(val, msg, assert.notInstanceOf, true)
|
|
898
854
|
.to.not.be.instanceOf(type);
|
|
@@ -923,12 +879,11 @@ assert.notInstanceOf = function (val, type, msg) {
|
|
|
923
879
|
*
|
|
924
880
|
* @name include
|
|
925
881
|
* @param {Array|String} haystack
|
|
926
|
-
* @param {
|
|
882
|
+
* @param {unknown} needle
|
|
927
883
|
* @param {String} message
|
|
928
884
|
* @namespace Assert
|
|
929
|
-
* @
|
|
885
|
+
* @public
|
|
930
886
|
*/
|
|
931
|
-
|
|
932
887
|
assert.include = function (exp, inc, msg) {
|
|
933
888
|
new Assertion(exp, msg, assert.include, true).include(inc);
|
|
934
889
|
};
|
|
@@ -959,12 +914,11 @@ assert.include = function (exp, inc, msg) {
|
|
|
959
914
|
*
|
|
960
915
|
* @name notInclude
|
|
961
916
|
* @param {Array|String} haystack
|
|
962
|
-
* @param {
|
|
917
|
+
* @param {unknown} needle
|
|
963
918
|
* @param {String} message
|
|
964
919
|
* @namespace Assert
|
|
965
|
-
* @
|
|
920
|
+
* @public
|
|
966
921
|
*/
|
|
967
|
-
|
|
968
922
|
assert.notInclude = function (exp, inc, msg) {
|
|
969
923
|
new Assertion(exp, msg, assert.notInclude, true).not.include(inc);
|
|
970
924
|
};
|
|
@@ -984,12 +938,11 @@ assert.notInclude = function (exp, inc, msg) {
|
|
|
984
938
|
*
|
|
985
939
|
* @name deepInclude
|
|
986
940
|
* @param {Array|String} haystack
|
|
987
|
-
* @param {
|
|
941
|
+
* @param {unknown} needle
|
|
988
942
|
* @param {String} message
|
|
989
943
|
* @namespace Assert
|
|
990
|
-
* @
|
|
944
|
+
* @public
|
|
991
945
|
*/
|
|
992
|
-
|
|
993
946
|
assert.deepInclude = function (exp, inc, msg) {
|
|
994
947
|
new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc);
|
|
995
948
|
};
|
|
@@ -1009,12 +962,11 @@ assert.deepInclude = function (exp, inc, msg) {
|
|
|
1009
962
|
*
|
|
1010
963
|
* @name notDeepInclude
|
|
1011
964
|
* @param {Array|String} haystack
|
|
1012
|
-
* @param {
|
|
965
|
+
* @param {unknown} needle
|
|
1013
966
|
* @param {String} message
|
|
1014
967
|
* @namespace Assert
|
|
1015
|
-
* @
|
|
968
|
+
* @public
|
|
1016
969
|
*/
|
|
1017
|
-
|
|
1018
970
|
assert.notDeepInclude = function (exp, inc, msg) {
|
|
1019
971
|
new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc);
|
|
1020
972
|
};
|
|
@@ -1037,9 +989,8 @@ assert.notDeepInclude = function (exp, inc, msg) {
|
|
|
1037
989
|
* @param {Object} needle
|
|
1038
990
|
* @param {String} message
|
|
1039
991
|
* @namespace Assert
|
|
1040
|
-
* @
|
|
992
|
+
* @public
|
|
1041
993
|
*/
|
|
1042
|
-
|
|
1043
994
|
assert.nestedInclude = function (exp, inc, msg) {
|
|
1044
995
|
new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc);
|
|
1045
996
|
};
|
|
@@ -1062,9 +1013,8 @@ assert.nestedInclude = function (exp, inc, msg) {
|
|
|
1062
1013
|
* @param {Object} needle
|
|
1063
1014
|
* @param {String} message
|
|
1064
1015
|
* @namespace Assert
|
|
1065
|
-
* @
|
|
1016
|
+
* @public
|
|
1066
1017
|
*/
|
|
1067
|
-
|
|
1068
1018
|
assert.notNestedInclude = function (exp, inc, msg) {
|
|
1069
1019
|
new Assertion(exp, msg, assert.notNestedInclude, true)
|
|
1070
1020
|
.not.nested.include(inc);
|
|
@@ -1088,9 +1038,8 @@ assert.notNestedInclude = function (exp, inc, msg) {
|
|
|
1088
1038
|
* @param {Object} needle
|
|
1089
1039
|
* @param {String} message
|
|
1090
1040
|
* @namespace Assert
|
|
1091
|
-
* @
|
|
1041
|
+
* @public
|
|
1092
1042
|
*/
|
|
1093
|
-
|
|
1094
1043
|
assert.deepNestedInclude = function(exp, inc, msg) {
|
|
1095
1044
|
new Assertion(exp, msg, assert.deepNestedInclude, true)
|
|
1096
1045
|
.deep.nested.include(inc);
|
|
@@ -1114,9 +1063,8 @@ assert.deepNestedInclude = function(exp, inc, msg) {
|
|
|
1114
1063
|
* @param {Object} needle
|
|
1115
1064
|
* @param {String} message
|
|
1116
1065
|
* @namespace Assert
|
|
1117
|
-
* @
|
|
1066
|
+
* @public
|
|
1118
1067
|
*/
|
|
1119
|
-
|
|
1120
1068
|
assert.notDeepNestedInclude = function(exp, inc, msg) {
|
|
1121
1069
|
new Assertion(exp, msg, assert.notDeepNestedInclude, true)
|
|
1122
1070
|
.not.deep.nested.include(inc);
|
|
@@ -1136,9 +1084,8 @@ assert.notDeepNestedInclude = function(exp, inc, msg) {
|
|
|
1136
1084
|
* @param {Object} needle
|
|
1137
1085
|
* @param {String} message
|
|
1138
1086
|
* @namespace Assert
|
|
1139
|
-
* @
|
|
1087
|
+
* @public
|
|
1140
1088
|
*/
|
|
1141
|
-
|
|
1142
1089
|
assert.ownInclude = function(exp, inc, msg) {
|
|
1143
1090
|
new Assertion(exp, msg, assert.ownInclude, true).own.include(inc);
|
|
1144
1091
|
};
|
|
@@ -1146,7 +1093,7 @@ assert.ownInclude = function(exp, inc, msg) {
|
|
|
1146
1093
|
/**
|
|
1147
1094
|
* ### .notOwnInclude(haystack, needle, [message])
|
|
1148
1095
|
*
|
|
1149
|
-
* Asserts that 'haystack'
|
|
1096
|
+
* Asserts that 'haystack' does not include 'needle'.
|
|
1150
1097
|
* Can be used to assert the absence of a subset of properties in an
|
|
1151
1098
|
* object while ignoring inherited properties.
|
|
1152
1099
|
*
|
|
@@ -1159,9 +1106,8 @@ assert.ownInclude = function(exp, inc, msg) {
|
|
|
1159
1106
|
* @param {Object} needle
|
|
1160
1107
|
* @param {String} message
|
|
1161
1108
|
* @namespace Assert
|
|
1162
|
-
* @
|
|
1109
|
+
* @public
|
|
1163
1110
|
*/
|
|
1164
|
-
|
|
1165
1111
|
assert.notOwnInclude = function(exp, inc, msg) {
|
|
1166
1112
|
new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc);
|
|
1167
1113
|
};
|
|
@@ -1180,9 +1126,8 @@ assert.notOwnInclude = function(exp, inc, msg) {
|
|
|
1180
1126
|
* @param {Object} needle
|
|
1181
1127
|
* @param {String} message
|
|
1182
1128
|
* @namespace Assert
|
|
1183
|
-
* @
|
|
1129
|
+
* @public
|
|
1184
1130
|
*/
|
|
1185
|
-
|
|
1186
1131
|
assert.deepOwnInclude = function(exp, inc, msg) {
|
|
1187
1132
|
new Assertion(exp, msg, assert.deepOwnInclude, true)
|
|
1188
1133
|
.deep.own.include(inc);
|
|
@@ -1191,7 +1136,7 @@ assert.deepOwnInclude = function(exp, inc, msg) {
|
|
|
1191
1136
|
/**
|
|
1192
1137
|
* ### .notDeepOwnInclude(haystack, needle, [message])
|
|
1193
1138
|
*
|
|
1194
|
-
* Asserts that 'haystack'
|
|
1139
|
+
* Asserts that 'haystack' does not include 'needle'.
|
|
1195
1140
|
* Can be used to assert the absence of a subset of properties in an
|
|
1196
1141
|
* object while ignoring inherited properties and checking for deep equality.
|
|
1197
1142
|
*
|
|
@@ -1202,9 +1147,8 @@ assert.deepOwnInclude = function(exp, inc, msg) {
|
|
|
1202
1147
|
* @param {Object} needle
|
|
1203
1148
|
* @param {String} message
|
|
1204
1149
|
* @namespace Assert
|
|
1205
|
-
* @
|
|
1150
|
+
* @public
|
|
1206
1151
|
*/
|
|
1207
|
-
|
|
1208
1152
|
assert.notDeepOwnInclude = function(exp, inc, msg) {
|
|
1209
1153
|
new Assertion(exp, msg, assert.notDeepOwnInclude, true)
|
|
1210
1154
|
.not.deep.own.include(inc);
|
|
@@ -1218,13 +1162,12 @@ assert.notDeepOwnInclude = function(exp, inc, msg) {
|
|
|
1218
1162
|
* assert.match('foobar', /^foo/, 'regexp matches');
|
|
1219
1163
|
*
|
|
1220
1164
|
* @name match
|
|
1221
|
-
* @param {
|
|
1165
|
+
* @param {unknown} value
|
|
1222
1166
|
* @param {RegExp} regexp
|
|
1223
1167
|
* @param {String} message
|
|
1224
1168
|
* @namespace Assert
|
|
1225
|
-
* @
|
|
1169
|
+
* @public
|
|
1226
1170
|
*/
|
|
1227
|
-
|
|
1228
1171
|
assert.match = function (exp, re, msg) {
|
|
1229
1172
|
new Assertion(exp, msg, assert.match, true).to.match(re);
|
|
1230
1173
|
};
|
|
@@ -1237,13 +1180,12 @@ assert.match = function (exp, re, msg) {
|
|
|
1237
1180
|
* assert.notMatch('foobar', /^foo/, 'regexp does not match');
|
|
1238
1181
|
*
|
|
1239
1182
|
* @name notMatch
|
|
1240
|
-
* @param {
|
|
1183
|
+
* @param {unknown} value
|
|
1241
1184
|
* @param {RegExp} regexp
|
|
1242
1185
|
* @param {String} message
|
|
1243
1186
|
* @namespace Assert
|
|
1244
|
-
* @
|
|
1187
|
+
* @public
|
|
1245
1188
|
*/
|
|
1246
|
-
|
|
1247
1189
|
assert.notMatch = function (exp, re, msg) {
|
|
1248
1190
|
new Assertion(exp, msg, assert.notMatch, true).to.not.match(re);
|
|
1249
1191
|
};
|
|
@@ -1262,9 +1204,8 @@ assert.notMatch = function (exp, re, msg) {
|
|
|
1262
1204
|
* @param {String} property
|
|
1263
1205
|
* @param {String} message
|
|
1264
1206
|
* @namespace Assert
|
|
1265
|
-
* @
|
|
1207
|
+
* @public
|
|
1266
1208
|
*/
|
|
1267
|
-
|
|
1268
1209
|
assert.property = function (obj, prop, msg) {
|
|
1269
1210
|
new Assertion(obj, msg, assert.property, true).to.have.property(prop);
|
|
1270
1211
|
};
|
|
@@ -1282,9 +1223,8 @@ assert.property = function (obj, prop, msg) {
|
|
|
1282
1223
|
* @param {String} property
|
|
1283
1224
|
* @param {String} message
|
|
1284
1225
|
* @namespace Assert
|
|
1285
|
-
* @
|
|
1226
|
+
* @public
|
|
1286
1227
|
*/
|
|
1287
|
-
|
|
1288
1228
|
assert.notProperty = function (obj, prop, msg) {
|
|
1289
1229
|
new Assertion(obj, msg, assert.notProperty, true)
|
|
1290
1230
|
.to.not.have.property(prop);
|
|
@@ -1302,12 +1242,11 @@ assert.notProperty = function (obj, prop, msg) {
|
|
|
1302
1242
|
* @name propertyVal
|
|
1303
1243
|
* @param {Object} object
|
|
1304
1244
|
* @param {String} property
|
|
1305
|
-
* @param {
|
|
1245
|
+
* @param {unknown} value
|
|
1306
1246
|
* @param {String} message
|
|
1307
1247
|
* @namespace Assert
|
|
1308
|
-
* @
|
|
1248
|
+
* @public
|
|
1309
1249
|
*/
|
|
1310
|
-
|
|
1311
1250
|
assert.propertyVal = function (obj, prop, val, msg) {
|
|
1312
1251
|
new Assertion(obj, msg, assert.propertyVal, true)
|
|
1313
1252
|
.to.have.property(prop, val);
|
|
@@ -1326,12 +1265,11 @@ assert.propertyVal = function (obj, prop, val, msg) {
|
|
|
1326
1265
|
* @name notPropertyVal
|
|
1327
1266
|
* @param {Object} object
|
|
1328
1267
|
* @param {String} property
|
|
1329
|
-
* @param {
|
|
1268
|
+
* @param {unknown} value
|
|
1330
1269
|
* @param {String} message
|
|
1331
1270
|
* @namespace Assert
|
|
1332
|
-
* @
|
|
1271
|
+
* @public
|
|
1333
1272
|
*/
|
|
1334
|
-
|
|
1335
1273
|
assert.notPropertyVal = function (obj, prop, val, msg) {
|
|
1336
1274
|
new Assertion(obj, msg, assert.notPropertyVal, true)
|
|
1337
1275
|
.to.not.have.property(prop, val);
|
|
@@ -1348,12 +1286,11 @@ assert.notPropertyVal = function (obj, prop, val, msg) {
|
|
|
1348
1286
|
* @name deepPropertyVal
|
|
1349
1287
|
* @param {Object} object
|
|
1350
1288
|
* @param {String} property
|
|
1351
|
-
* @param {
|
|
1289
|
+
* @param {unknown} value
|
|
1352
1290
|
* @param {String} message
|
|
1353
1291
|
* @namespace Assert
|
|
1354
|
-
* @
|
|
1292
|
+
* @public
|
|
1355
1293
|
*/
|
|
1356
|
-
|
|
1357
1294
|
assert.deepPropertyVal = function (obj, prop, val, msg) {
|
|
1358
1295
|
new Assertion(obj, msg, assert.deepPropertyVal, true)
|
|
1359
1296
|
.to.have.deep.property(prop, val);
|
|
@@ -1372,12 +1309,11 @@ assert.deepPropertyVal = function (obj, prop, val, msg) {
|
|
|
1372
1309
|
* @name notDeepPropertyVal
|
|
1373
1310
|
* @param {Object} object
|
|
1374
1311
|
* @param {String} property
|
|
1375
|
-
* @param {
|
|
1312
|
+
* @param {unknown} value
|
|
1376
1313
|
* @param {String} message
|
|
1377
1314
|
* @namespace Assert
|
|
1378
|
-
* @
|
|
1315
|
+
* @public
|
|
1379
1316
|
*/
|
|
1380
|
-
|
|
1381
1317
|
assert.notDeepPropertyVal = function (obj, prop, val, msg) {
|
|
1382
1318
|
new Assertion(obj, msg, assert.notDeepPropertyVal, true)
|
|
1383
1319
|
.to.not.have.deep.property(prop, val);
|
|
@@ -1395,9 +1331,8 @@ assert.notDeepPropertyVal = function (obj, prop, val, msg) {
|
|
|
1395
1331
|
* @param {Object} object
|
|
1396
1332
|
* @param {String} property
|
|
1397
1333
|
* @param {String} message
|
|
1398
|
-
* @
|
|
1334
|
+
* @public
|
|
1399
1335
|
*/
|
|
1400
|
-
|
|
1401
1336
|
assert.ownProperty = function (obj, prop, msg) {
|
|
1402
1337
|
new Assertion(obj, msg, assert.ownProperty, true)
|
|
1403
1338
|
.to.have.own.property(prop);
|
|
@@ -1416,9 +1351,8 @@ assert.ownProperty = function (obj, prop, msg) {
|
|
|
1416
1351
|
* @param {Object} object
|
|
1417
1352
|
* @param {String} property
|
|
1418
1353
|
* @param {String} message
|
|
1419
|
-
* @
|
|
1354
|
+
* @public
|
|
1420
1355
|
*/
|
|
1421
|
-
|
|
1422
1356
|
assert.notOwnProperty = function (obj, prop, msg) {
|
|
1423
1357
|
new Assertion(obj, msg, assert.notOwnProperty, true)
|
|
1424
1358
|
.to.not.have.own.property(prop);
|
|
@@ -1436,11 +1370,10 @@ assert.notOwnProperty = function (obj, prop, msg) {
|
|
|
1436
1370
|
* @name ownPropertyVal
|
|
1437
1371
|
* @param {Object} object
|
|
1438
1372
|
* @param {String} property
|
|
1439
|
-
* @param {
|
|
1373
|
+
* @param {unknown} value
|
|
1440
1374
|
* @param {String} message
|
|
1441
|
-
* @
|
|
1375
|
+
* @public
|
|
1442
1376
|
*/
|
|
1443
|
-
|
|
1444
1377
|
assert.ownPropertyVal = function (obj, prop, value, msg) {
|
|
1445
1378
|
new Assertion(obj, msg, assert.ownPropertyVal, true)
|
|
1446
1379
|
.to.have.own.property(prop, value);
|
|
@@ -1459,11 +1392,10 @@ assert.ownPropertyVal = function (obj, prop, value, msg) {
|
|
|
1459
1392
|
* @name notOwnPropertyVal
|
|
1460
1393
|
* @param {Object} object
|
|
1461
1394
|
* @param {String} property
|
|
1462
|
-
* @param {
|
|
1395
|
+
* @param {unknown} value
|
|
1463
1396
|
* @param {String} message
|
|
1464
|
-
* @
|
|
1397
|
+
* @public
|
|
1465
1398
|
*/
|
|
1466
|
-
|
|
1467
1399
|
assert.notOwnPropertyVal = function (obj, prop, value, msg) {
|
|
1468
1400
|
new Assertion(obj, msg, assert.notOwnPropertyVal, true)
|
|
1469
1401
|
.to.not.have.own.property(prop, value);
|
|
@@ -1481,11 +1413,10 @@ assert.notOwnPropertyVal = function (obj, prop, value, msg) {
|
|
|
1481
1413
|
* @name deepOwnPropertyVal
|
|
1482
1414
|
* @param {Object} object
|
|
1483
1415
|
* @param {String} property
|
|
1484
|
-
* @param {
|
|
1416
|
+
* @param {unknown} value
|
|
1485
1417
|
* @param {String} message
|
|
1486
|
-
* @
|
|
1418
|
+
* @public
|
|
1487
1419
|
*/
|
|
1488
|
-
|
|
1489
1420
|
assert.deepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
1490
1421
|
new Assertion(obj, msg, assert.deepOwnPropertyVal, true)
|
|
1491
1422
|
.to.have.deep.own.property(prop, value);
|
|
@@ -1506,11 +1437,10 @@ assert.deepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
|
1506
1437
|
* @name notDeepOwnPropertyVal
|
|
1507
1438
|
* @param {Object} object
|
|
1508
1439
|
* @param {String} property
|
|
1509
|
-
* @param {
|
|
1440
|
+
* @param {unknown} value
|
|
1510
1441
|
* @param {String} message
|
|
1511
|
-
* @
|
|
1442
|
+
* @public
|
|
1512
1443
|
*/
|
|
1513
|
-
|
|
1514
1444
|
assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
1515
1445
|
new Assertion(obj, msg, assert.notDeepOwnPropertyVal, true)
|
|
1516
1446
|
.to.not.have.deep.own.property(prop, value);
|
|
@@ -1530,9 +1460,8 @@ assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
|
1530
1460
|
* @param {String} property
|
|
1531
1461
|
* @param {String} message
|
|
1532
1462
|
* @namespace Assert
|
|
1533
|
-
* @
|
|
1463
|
+
* @public
|
|
1534
1464
|
*/
|
|
1535
|
-
|
|
1536
1465
|
assert.nestedProperty = function (obj, prop, msg) {
|
|
1537
1466
|
new Assertion(obj, msg, assert.nestedProperty, true)
|
|
1538
1467
|
.to.have.nested.property(prop);
|
|
@@ -1552,9 +1481,8 @@ assert.nestedProperty = function (obj, prop, msg) {
|
|
|
1552
1481
|
* @param {String} property
|
|
1553
1482
|
* @param {String} message
|
|
1554
1483
|
* @namespace Assert
|
|
1555
|
-
* @
|
|
1484
|
+
* @public
|
|
1556
1485
|
*/
|
|
1557
|
-
|
|
1558
1486
|
assert.notNestedProperty = function (obj, prop, msg) {
|
|
1559
1487
|
new Assertion(obj, msg, assert.notNestedProperty, true)
|
|
1560
1488
|
.to.not.have.nested.property(prop);
|
|
@@ -1572,12 +1500,11 @@ assert.notNestedProperty = function (obj, prop, msg) {
|
|
|
1572
1500
|
* @name nestedPropertyVal
|
|
1573
1501
|
* @param {Object} object
|
|
1574
1502
|
* @param {String} property
|
|
1575
|
-
* @param {
|
|
1503
|
+
* @param {unknown} value
|
|
1576
1504
|
* @param {String} message
|
|
1577
1505
|
* @namespace Assert
|
|
1578
|
-
* @
|
|
1506
|
+
* @public
|
|
1579
1507
|
*/
|
|
1580
|
-
|
|
1581
1508
|
assert.nestedPropertyVal = function (obj, prop, val, msg) {
|
|
1582
1509
|
new Assertion(obj, msg, assert.nestedPropertyVal, true)
|
|
1583
1510
|
.to.have.nested.property(prop, val);
|
|
@@ -1596,12 +1523,11 @@ assert.nestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1596
1523
|
* @name notNestedPropertyVal
|
|
1597
1524
|
* @param {Object} object
|
|
1598
1525
|
* @param {String} property
|
|
1599
|
-
* @param {
|
|
1526
|
+
* @param {unknown} value
|
|
1600
1527
|
* @param {String} message
|
|
1601
1528
|
* @namespace Assert
|
|
1602
|
-
* @
|
|
1529
|
+
* @public
|
|
1603
1530
|
*/
|
|
1604
|
-
|
|
1605
1531
|
assert.notNestedPropertyVal = function (obj, prop, val, msg) {
|
|
1606
1532
|
new Assertion(obj, msg, assert.notNestedPropertyVal, true)
|
|
1607
1533
|
.to.not.have.nested.property(prop, val);
|
|
@@ -1619,12 +1545,11 @@ assert.notNestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1619
1545
|
* @name deepNestedPropertyVal
|
|
1620
1546
|
* @param {Object} object
|
|
1621
1547
|
* @param {String} property
|
|
1622
|
-
* @param {
|
|
1548
|
+
* @param {unknown} value
|
|
1623
1549
|
* @param {String} message
|
|
1624
1550
|
* @namespace Assert
|
|
1625
|
-
* @
|
|
1551
|
+
* @public
|
|
1626
1552
|
*/
|
|
1627
|
-
|
|
1628
1553
|
assert.deepNestedPropertyVal = function (obj, prop, val, msg) {
|
|
1629
1554
|
new Assertion(obj, msg, assert.deepNestedPropertyVal, true)
|
|
1630
1555
|
.to.have.deep.nested.property(prop, val);
|
|
@@ -1644,12 +1569,11 @@ assert.deepNestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1644
1569
|
* @name notDeepNestedPropertyVal
|
|
1645
1570
|
* @param {Object} object
|
|
1646
1571
|
* @param {String} property
|
|
1647
|
-
* @param {
|
|
1572
|
+
* @param {unknown} value
|
|
1648
1573
|
* @param {String} message
|
|
1649
1574
|
* @namespace Assert
|
|
1650
|
-
* @
|
|
1575
|
+
* @public
|
|
1651
1576
|
*/
|
|
1652
|
-
|
|
1653
1577
|
assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) {
|
|
1654
1578
|
new Assertion(obj, msg, assert.notDeepNestedPropertyVal, true)
|
|
1655
1579
|
.to.not.have.deep.nested.property(prop, val);
|
|
@@ -1666,13 +1590,12 @@ assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1666
1590
|
* assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3');
|
|
1667
1591
|
*
|
|
1668
1592
|
* @name lengthOf
|
|
1669
|
-
* @param {
|
|
1593
|
+
* @param {unknown} object
|
|
1670
1594
|
* @param {Number} length
|
|
1671
1595
|
* @param {String} message
|
|
1672
1596
|
* @namespace Assert
|
|
1673
|
-
* @
|
|
1597
|
+
* @public
|
|
1674
1598
|
*/
|
|
1675
|
-
|
|
1676
1599
|
assert.lengthOf = function (exp, len, msg) {
|
|
1677
1600
|
new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len);
|
|
1678
1601
|
};
|
|
@@ -1690,13 +1613,12 @@ assert.lengthOf = function (exp, len, msg) {
|
|
|
1690
1613
|
* assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
|
1691
1614
|
*
|
|
1692
1615
|
* @name hasAnyKeys
|
|
1693
|
-
* @param {
|
|
1616
|
+
* @param {unknown} object
|
|
1694
1617
|
* @param {Array|Object} keys
|
|
1695
1618
|
* @param {String} message
|
|
1696
1619
|
* @namespace Assert
|
|
1697
|
-
* @
|
|
1620
|
+
* @public
|
|
1698
1621
|
*/
|
|
1699
|
-
|
|
1700
1622
|
assert.hasAnyKeys = function (obj, keys, msg) {
|
|
1701
1623
|
new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys);
|
|
1702
1624
|
}
|
|
@@ -1711,16 +1633,15 @@ assert.hasAnyKeys = function (obj, keys, msg) {
|
|
|
1711
1633
|
* assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']);
|
|
1712
1634
|
* assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337]);
|
|
1713
1635
|
* assert.hasAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
|
|
1714
|
-
* assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']);
|
|
1636
|
+
* assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
|
1715
1637
|
*
|
|
1716
1638
|
* @name hasAllKeys
|
|
1717
|
-
* @param {
|
|
1639
|
+
* @param {unknown} object
|
|
1718
1640
|
* @param {String[]} keys
|
|
1719
1641
|
* @param {String} message
|
|
1720
1642
|
* @namespace Assert
|
|
1721
|
-
* @
|
|
1643
|
+
* @public
|
|
1722
1644
|
*/
|
|
1723
|
-
|
|
1724
1645
|
assert.hasAllKeys = function (obj, keys, msg) {
|
|
1725
1646
|
new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys);
|
|
1726
1647
|
}
|
|
@@ -1738,17 +1659,16 @@ assert.hasAllKeys = function (obj, keys, msg) {
|
|
|
1738
1659
|
* assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337});
|
|
1739
1660
|
* assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]);
|
|
1740
1661
|
* assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
|
|
1741
|
-
* assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}]);
|
|
1742
|
-
* assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']);
|
|
1662
|
+
* assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}]);
|
|
1663
|
+
* assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
|
1743
1664
|
*
|
|
1744
1665
|
* @name containsAllKeys
|
|
1745
|
-
* @param {
|
|
1666
|
+
* @param {unknown} object
|
|
1746
1667
|
* @param {String[]} keys
|
|
1747
1668
|
* @param {String} message
|
|
1748
1669
|
* @namespace Assert
|
|
1749
|
-
* @
|
|
1670
|
+
* @public
|
|
1750
1671
|
*/
|
|
1751
|
-
|
|
1752
1672
|
assert.containsAllKeys = function (obj, keys, msg) {
|
|
1753
1673
|
new Assertion(obj, msg, assert.containsAllKeys, true)
|
|
1754
1674
|
.to.contain.all.keys(keys);
|
|
@@ -1764,16 +1684,15 @@ assert.containsAllKeys = function (obj, keys, msg) {
|
|
|
1764
1684
|
* assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']);
|
|
1765
1685
|
* assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'});
|
|
1766
1686
|
* assert.doesNotHaveAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']);
|
|
1767
|
-
* assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']);
|
|
1687
|
+
* assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']);
|
|
1768
1688
|
*
|
|
1769
1689
|
* @name doesNotHaveAnyKeys
|
|
1770
|
-
* @param {
|
|
1690
|
+
* @param {unknown} object
|
|
1771
1691
|
* @param {String[]} keys
|
|
1772
1692
|
* @param {String} message
|
|
1773
1693
|
* @namespace Assert
|
|
1774
|
-
* @
|
|
1694
|
+
* @public
|
|
1775
1695
|
*/
|
|
1776
|
-
|
|
1777
1696
|
assert.doesNotHaveAnyKeys = function (obj, keys, msg) {
|
|
1778
1697
|
new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true)
|
|
1779
1698
|
.to.not.have.any.keys(keys);
|
|
@@ -1789,16 +1708,15 @@ assert.doesNotHaveAnyKeys = function (obj, keys, msg) {
|
|
|
1789
1708
|
* assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']);
|
|
1790
1709
|
* assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'});
|
|
1791
1710
|
* assert.doesNotHaveAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']);
|
|
1792
|
-
* assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']);
|
|
1711
|
+
* assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']);
|
|
1793
1712
|
*
|
|
1794
1713
|
* @name doesNotHaveAllKeys
|
|
1795
|
-
* @param {
|
|
1714
|
+
* @param {unknown} object
|
|
1796
1715
|
* @param {String[]} keys
|
|
1797
1716
|
* @param {String} message
|
|
1798
1717
|
* @namespace Assert
|
|
1799
|
-
* @
|
|
1718
|
+
* @public
|
|
1800
1719
|
*/
|
|
1801
|
-
|
|
1802
1720
|
assert.doesNotHaveAllKeys = function (obj, keys, msg) {
|
|
1803
1721
|
new Assertion(obj, msg, assert.doesNotHaveAllKeys, true)
|
|
1804
1722
|
.to.not.have.all.keys(keys);
|
|
@@ -1821,13 +1739,12 @@ assert.doesNotHaveAllKeys = function (obj, keys, msg) {
|
|
|
1821
1739
|
* assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
|
1822
1740
|
*
|
|
1823
1741
|
* @name hasAnyDeepKeys
|
|
1824
|
-
* @param {
|
|
1742
|
+
* @param {unknown} object
|
|
1825
1743
|
* @param {Array|Object} keys
|
|
1826
1744
|
* @param {String} message
|
|
1827
1745
|
* @namespace Assert
|
|
1828
|
-
* @
|
|
1746
|
+
* @public
|
|
1829
1747
|
*/
|
|
1830
|
-
|
|
1831
1748
|
assert.hasAnyDeepKeys = function (obj, keys, msg) {
|
|
1832
1749
|
new Assertion(obj, msg, assert.hasAnyDeepKeys, true)
|
|
1833
1750
|
.to.have.any.deep.keys(keys);
|
|
@@ -1848,13 +1765,12 @@ assert.hasAnyDeepKeys = function (obj, keys, msg) {
|
|
|
1848
1765
|
* assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
|
1849
1766
|
*
|
|
1850
1767
|
* @name hasAllDeepKeys
|
|
1851
|
-
* @param {
|
|
1768
|
+
* @param {unknown} object
|
|
1852
1769
|
* @param {Array|Object} keys
|
|
1853
1770
|
* @param {String} message
|
|
1854
1771
|
* @namespace Assert
|
|
1855
|
-
* @
|
|
1772
|
+
* @public
|
|
1856
1773
|
*/
|
|
1857
|
-
|
|
1858
1774
|
assert.hasAllDeepKeys = function (obj, keys, msg) {
|
|
1859
1775
|
new Assertion(obj, msg, assert.hasAllDeepKeys, true)
|
|
1860
1776
|
.to.have.all.deep.keys(keys);
|
|
@@ -1875,13 +1791,12 @@ assert.hasAllDeepKeys = function (obj, keys, msg) {
|
|
|
1875
1791
|
* assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
|
1876
1792
|
*
|
|
1877
1793
|
* @name containsAllDeepKeys
|
|
1878
|
-
* @param {
|
|
1794
|
+
* @param {unknown} object
|
|
1879
1795
|
* @param {Array|Object} keys
|
|
1880
1796
|
* @param {String} message
|
|
1881
1797
|
* @namespace Assert
|
|
1882
|
-
* @
|
|
1798
|
+
* @public
|
|
1883
1799
|
*/
|
|
1884
|
-
|
|
1885
1800
|
assert.containsAllDeepKeys = function (obj, keys, msg) {
|
|
1886
1801
|
new Assertion(obj, msg, assert.containsAllDeepKeys, true)
|
|
1887
1802
|
.to.contain.all.deep.keys(keys);
|
|
@@ -1902,13 +1817,12 @@ assert.containsAllDeepKeys = function (obj, keys, msg) {
|
|
|
1902
1817
|
* assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]);
|
|
1903
1818
|
*
|
|
1904
1819
|
* @name doesNotHaveAnyDeepKeys
|
|
1905
|
-
* @param {
|
|
1820
|
+
* @param {unknown} object
|
|
1906
1821
|
* @param {Array|Object} keys
|
|
1907
1822
|
* @param {String} message
|
|
1908
1823
|
* @namespace Assert
|
|
1909
|
-
* @
|
|
1824
|
+
* @public
|
|
1910
1825
|
*/
|
|
1911
|
-
|
|
1912
1826
|
assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) {
|
|
1913
1827
|
new Assertion(obj, msg, assert.doesNotHaveAnyDeepKeys, true)
|
|
1914
1828
|
.to.not.have.any.deep.keys(keys);
|
|
@@ -1929,13 +1843,12 @@ assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) {
|
|
|
1929
1843
|
* assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]);
|
|
1930
1844
|
*
|
|
1931
1845
|
* @name doesNotHaveAllDeepKeys
|
|
1932
|
-
* @param {
|
|
1846
|
+
* @param {unknown} object
|
|
1933
1847
|
* @param {Array|Object} keys
|
|
1934
1848
|
* @param {String} message
|
|
1935
1849
|
* @namespace Assert
|
|
1936
|
-
* @
|
|
1850
|
+
* @public
|
|
1937
1851
|
*/
|
|
1938
|
-
|
|
1939
1852
|
assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) {
|
|
1940
1853
|
new Assertion(obj, msg, assert.doesNotHaveAllDeepKeys, true)
|
|
1941
1854
|
.to.not.have.all.deep.keys(keys);
|
|
@@ -1969,9 +1882,8 @@ assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) {
|
|
|
1969
1882
|
* @param {String} message
|
|
1970
1883
|
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
|
|
1971
1884
|
* @namespace Assert
|
|
1972
|
-
* @
|
|
1885
|
+
* @public
|
|
1973
1886
|
*/
|
|
1974
|
-
|
|
1975
1887
|
assert.throws = function (fn, errorLike, errMsgMatcher, msg) {
|
|
1976
1888
|
if ('string' === typeof errorLike || errorLike instanceof RegExp) {
|
|
1977
1889
|
errMsgMatcher = errorLike;
|
|
@@ -2009,9 +1921,8 @@ assert.throws = function (fn, errorLike, errMsgMatcher, msg) {
|
|
|
2009
1921
|
* @param {String} message
|
|
2010
1922
|
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
|
|
2011
1923
|
* @namespace Assert
|
|
2012
|
-
* @
|
|
1924
|
+
* @public
|
|
2013
1925
|
*/
|
|
2014
|
-
|
|
2015
1926
|
assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) {
|
|
2016
1927
|
if ('string' === typeof errorLike || errorLike instanceof RegExp) {
|
|
2017
1928
|
errMsgMatcher = errorLike;
|
|
@@ -2031,14 +1942,13 @@ assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) {
|
|
|
2031
1942
|
* assert.operator(1, '>', 2, 'this will fail');
|
|
2032
1943
|
*
|
|
2033
1944
|
* @name operator
|
|
2034
|
-
* @param {
|
|
1945
|
+
* @param {unknown} val1
|
|
2035
1946
|
* @param {String} operator
|
|
2036
|
-
* @param {
|
|
1947
|
+
* @param {unknown} val2
|
|
2037
1948
|
* @param {String} message
|
|
2038
1949
|
* @namespace Assert
|
|
2039
|
-
* @
|
|
1950
|
+
* @public
|
|
2040
1951
|
*/
|
|
2041
|
-
|
|
2042
1952
|
assert.operator = function (val, operator, val2, msg) {
|
|
2043
1953
|
var ok;
|
|
2044
1954
|
switch(operator) {
|
|
@@ -2094,9 +2004,8 @@ assert.operator = function (val, operator, val2, msg) {
|
|
|
2094
2004
|
* @param {Number} delta
|
|
2095
2005
|
* @param {String} message
|
|
2096
2006
|
* @namespace Assert
|
|
2097
|
-
* @
|
|
2007
|
+
* @public
|
|
2098
2008
|
*/
|
|
2099
|
-
|
|
2100
2009
|
assert.closeTo = function (act, exp, delta, msg) {
|
|
2101
2010
|
new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta);
|
|
2102
2011
|
};
|
|
@@ -2114,9 +2023,8 @@ assert.closeTo = function (act, exp, delta, msg) {
|
|
|
2114
2023
|
* @param {Number} delta
|
|
2115
2024
|
* @param {String} message
|
|
2116
2025
|
* @namespace Assert
|
|
2117
|
-
* @
|
|
2026
|
+
* @public
|
|
2118
2027
|
*/
|
|
2119
|
-
|
|
2120
2028
|
assert.approximately = function (act, exp, delta, msg) {
|
|
2121
2029
|
new Assertion(act, msg, assert.approximately, true)
|
|
2122
2030
|
.to.be.approximately(exp, delta);
|
|
@@ -2135,9 +2043,8 @@ assert.approximately = function (act, exp, delta, msg) {
|
|
|
2135
2043
|
* @param {Array} set2
|
|
2136
2044
|
* @param {String} message
|
|
2137
2045
|
* @namespace Assert
|
|
2138
|
-
* @
|
|
2046
|
+
* @public
|
|
2139
2047
|
*/
|
|
2140
|
-
|
|
2141
2048
|
assert.sameMembers = function (set1, set2, msg) {
|
|
2142
2049
|
new Assertion(set1, msg, assert.sameMembers, true)
|
|
2143
2050
|
.to.have.same.members(set2);
|
|
@@ -2156,9 +2063,8 @@ assert.sameMembers = function (set1, set2, msg) {
|
|
|
2156
2063
|
* @param {Array} set2
|
|
2157
2064
|
* @param {String} message
|
|
2158
2065
|
* @namespace Assert
|
|
2159
|
-
* @
|
|
2066
|
+
* @public
|
|
2160
2067
|
*/
|
|
2161
|
-
|
|
2162
2068
|
assert.notSameMembers = function (set1, set2, msg) {
|
|
2163
2069
|
new Assertion(set1, msg, assert.notSameMembers, true)
|
|
2164
2070
|
.to.not.have.same.members(set2);
|
|
@@ -2177,9 +2083,8 @@ assert.notSameMembers = function (set1, set2, msg) {
|
|
|
2177
2083
|
* @param {Array} set2
|
|
2178
2084
|
* @param {String} message
|
|
2179
2085
|
* @namespace Assert
|
|
2180
|
-
* @
|
|
2086
|
+
* @public
|
|
2181
2087
|
*/
|
|
2182
|
-
|
|
2183
2088
|
assert.sameDeepMembers = function (set1, set2, msg) {
|
|
2184
2089
|
new Assertion(set1, msg, assert.sameDeepMembers, true)
|
|
2185
2090
|
.to.have.same.deep.members(set2);
|
|
@@ -2198,9 +2103,8 @@ assert.sameDeepMembers = function (set1, set2, msg) {
|
|
|
2198
2103
|
* @param {Array} set2
|
|
2199
2104
|
* @param {String} message
|
|
2200
2105
|
* @namespace Assert
|
|
2201
|
-
* @
|
|
2106
|
+
* @public
|
|
2202
2107
|
*/
|
|
2203
|
-
|
|
2204
2108
|
assert.notSameDeepMembers = function (set1, set2, msg) {
|
|
2205
2109
|
new Assertion(set1, msg, assert.notSameDeepMembers, true)
|
|
2206
2110
|
.to.not.have.same.deep.members(set2);
|
|
@@ -2219,9 +2123,8 @@ assert.notSameDeepMembers = function (set1, set2, msg) {
|
|
|
2219
2123
|
* @param {Array} set2
|
|
2220
2124
|
* @param {String} message
|
|
2221
2125
|
* @namespace Assert
|
|
2222
|
-
* @
|
|
2126
|
+
* @public
|
|
2223
2127
|
*/
|
|
2224
|
-
|
|
2225
2128
|
assert.sameOrderedMembers = function (set1, set2, msg) {
|
|
2226
2129
|
new Assertion(set1, msg, assert.sameOrderedMembers, true)
|
|
2227
2130
|
.to.have.same.ordered.members(set2);
|
|
@@ -2240,9 +2143,8 @@ assert.sameOrderedMembers = function (set1, set2, msg) {
|
|
|
2240
2143
|
* @param {Array} set2
|
|
2241
2144
|
* @param {String} message
|
|
2242
2145
|
* @namespace Assert
|
|
2243
|
-
* @
|
|
2146
|
+
* @public
|
|
2244
2147
|
*/
|
|
2245
|
-
|
|
2246
2148
|
assert.notSameOrderedMembers = function (set1, set2, msg) {
|
|
2247
2149
|
new Assertion(set1, msg, assert.notSameOrderedMembers, true)
|
|
2248
2150
|
.to.not.have.same.ordered.members(set2);
|
|
@@ -2261,9 +2163,8 @@ assert.notSameOrderedMembers = function (set1, set2, msg) {
|
|
|
2261
2163
|
* @param {Array} set2
|
|
2262
2164
|
* @param {String} message
|
|
2263
2165
|
* @namespace Assert
|
|
2264
|
-
* @
|
|
2166
|
+
* @public
|
|
2265
2167
|
*/
|
|
2266
|
-
|
|
2267
2168
|
assert.sameDeepOrderedMembers = function (set1, set2, msg) {
|
|
2268
2169
|
new Assertion(set1, msg, assert.sameDeepOrderedMembers, true)
|
|
2269
2170
|
.to.have.same.deep.ordered.members(set2);
|
|
@@ -2283,9 +2184,8 @@ assert.sameDeepOrderedMembers = function (set1, set2, msg) {
|
|
|
2283
2184
|
* @param {Array} set2
|
|
2284
2185
|
* @param {String} message
|
|
2285
2186
|
* @namespace Assert
|
|
2286
|
-
* @
|
|
2187
|
+
* @public
|
|
2287
2188
|
*/
|
|
2288
|
-
|
|
2289
2189
|
assert.notSameDeepOrderedMembers = function (set1, set2, msg) {
|
|
2290
2190
|
new Assertion(set1, msg, assert.notSameDeepOrderedMembers, true)
|
|
2291
2191
|
.to.not.have.same.deep.ordered.members(set2);
|
|
@@ -2304,9 +2204,8 @@ assert.notSameDeepOrderedMembers = function (set1, set2, msg) {
|
|
|
2304
2204
|
* @param {Array} subset
|
|
2305
2205
|
* @param {String} message
|
|
2306
2206
|
* @namespace Assert
|
|
2307
|
-
* @
|
|
2207
|
+
* @public
|
|
2308
2208
|
*/
|
|
2309
|
-
|
|
2310
2209
|
assert.includeMembers = function (superset, subset, msg) {
|
|
2311
2210
|
new Assertion(superset, msg, assert.includeMembers, true)
|
|
2312
2211
|
.to.include.members(subset);
|
|
@@ -2325,9 +2224,8 @@ assert.includeMembers = function (superset, subset, msg) {
|
|
|
2325
2224
|
* @param {Array} subset
|
|
2326
2225
|
* @param {String} message
|
|
2327
2226
|
* @namespace Assert
|
|
2328
|
-
* @
|
|
2227
|
+
* @public
|
|
2329
2228
|
*/
|
|
2330
|
-
|
|
2331
2229
|
assert.notIncludeMembers = function (superset, subset, msg) {
|
|
2332
2230
|
new Assertion(superset, msg, assert.notIncludeMembers, true)
|
|
2333
2231
|
.to.not.include.members(subset);
|
|
@@ -2346,9 +2244,8 @@ assert.notIncludeMembers = function (superset, subset, msg) {
|
|
|
2346
2244
|
* @param {Array} subset
|
|
2347
2245
|
* @param {String} message
|
|
2348
2246
|
* @namespace Assert
|
|
2349
|
-
* @
|
|
2247
|
+
* @public
|
|
2350
2248
|
*/
|
|
2351
|
-
|
|
2352
2249
|
assert.includeDeepMembers = function (superset, subset, msg) {
|
|
2353
2250
|
new Assertion(superset, msg, assert.includeDeepMembers, true)
|
|
2354
2251
|
.to.include.deep.members(subset);
|
|
@@ -2367,9 +2264,8 @@ assert.includeDeepMembers = function (superset, subset, msg) {
|
|
|
2367
2264
|
* @param {Array} subset
|
|
2368
2265
|
* @param {String} message
|
|
2369
2266
|
* @namespace Assert
|
|
2370
|
-
* @
|
|
2267
|
+
* @public
|
|
2371
2268
|
*/
|
|
2372
|
-
|
|
2373
2269
|
assert.notIncludeDeepMembers = function (superset, subset, msg) {
|
|
2374
2270
|
new Assertion(superset, msg, assert.notIncludeDeepMembers, true)
|
|
2375
2271
|
.to.not.include.deep.members(subset);
|
|
@@ -2389,9 +2285,8 @@ assert.notIncludeDeepMembers = function (superset, subset, msg) {
|
|
|
2389
2285
|
* @param {Array} subset
|
|
2390
2286
|
* @param {String} message
|
|
2391
2287
|
* @namespace Assert
|
|
2392
|
-
* @
|
|
2288
|
+
* @public
|
|
2393
2289
|
*/
|
|
2394
|
-
|
|
2395
2290
|
assert.includeOrderedMembers = function (superset, subset, msg) {
|
|
2396
2291
|
new Assertion(superset, msg, assert.includeOrderedMembers, true)
|
|
2397
2292
|
.to.include.ordered.members(subset);
|
|
@@ -2412,9 +2307,8 @@ assert.includeOrderedMembers = function (superset, subset, msg) {
|
|
|
2412
2307
|
* @param {Array} subset
|
|
2413
2308
|
* @param {String} message
|
|
2414
2309
|
* @namespace Assert
|
|
2415
|
-
* @
|
|
2310
|
+
* @public
|
|
2416
2311
|
*/
|
|
2417
|
-
|
|
2418
2312
|
assert.notIncludeOrderedMembers = function (superset, subset, msg) {
|
|
2419
2313
|
new Assertion(superset, msg, assert.notIncludeOrderedMembers, true)
|
|
2420
2314
|
.to.not.include.ordered.members(subset);
|
|
@@ -2434,9 +2328,8 @@ assert.notIncludeOrderedMembers = function (superset, subset, msg) {
|
|
|
2434
2328
|
* @param {Array} subset
|
|
2435
2329
|
* @param {String} message
|
|
2436
2330
|
* @namespace Assert
|
|
2437
|
-
* @
|
|
2331
|
+
* @public
|
|
2438
2332
|
*/
|
|
2439
|
-
|
|
2440
2333
|
assert.includeDeepOrderedMembers = function (superset, subset, msg) {
|
|
2441
2334
|
new Assertion(superset, msg, assert.includeDeepOrderedMembers, true)
|
|
2442
2335
|
.to.include.deep.ordered.members(subset);
|
|
@@ -2458,9 +2351,8 @@ assert.includeDeepOrderedMembers = function (superset, subset, msg) {
|
|
|
2458
2351
|
* @param {Array} subset
|
|
2459
2352
|
* @param {String} message
|
|
2460
2353
|
* @namespace Assert
|
|
2461
|
-
* @
|
|
2354
|
+
* @public
|
|
2462
2355
|
*/
|
|
2463
|
-
|
|
2464
2356
|
assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) {
|
|
2465
2357
|
new Assertion(superset, msg, assert.notIncludeDeepOrderedMembers, true)
|
|
2466
2358
|
.to.not.include.deep.ordered.members(subset);
|
|
@@ -2478,13 +2370,39 @@ assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) {
|
|
|
2478
2370
|
* @param {Array<*>} list
|
|
2479
2371
|
* @param {String} message
|
|
2480
2372
|
* @namespace Assert
|
|
2481
|
-
* @
|
|
2373
|
+
* @public
|
|
2482
2374
|
*/
|
|
2483
|
-
|
|
2484
2375
|
assert.oneOf = function (inList, list, msg) {
|
|
2485
2376
|
new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list);
|
|
2486
2377
|
}
|
|
2487
2378
|
|
|
2379
|
+
/**
|
|
2380
|
+
* ### isIterable(obj, [message])
|
|
2381
|
+
*
|
|
2382
|
+
* Asserts that the target is an iterable, which means that it has a iterator
|
|
2383
|
+
* with the exception of `String.`
|
|
2384
|
+
*
|
|
2385
|
+
* assert.isIterable([1, 2]);
|
|
2386
|
+
*
|
|
2387
|
+
* @param {unknown} obj
|
|
2388
|
+
* @param {string} [msg]
|
|
2389
|
+
* @namespace Assert
|
|
2390
|
+
* @api public
|
|
2391
|
+
*/
|
|
2392
|
+
assert.isIterable = function(obj, msg) {
|
|
2393
|
+
if (obj == undefined || !obj[Symbol.iterator]) {
|
|
2394
|
+
msg = msg ?
|
|
2395
|
+
`${msg} expected ${inspect(obj)} to be an iterable` :
|
|
2396
|
+
`expected ${inspect(obj)} to be an iterable`;
|
|
2397
|
+
|
|
2398
|
+
throw new AssertionError(
|
|
2399
|
+
msg,
|
|
2400
|
+
undefined,
|
|
2401
|
+
assert.isIterable
|
|
2402
|
+
);
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2488
2406
|
/**
|
|
2489
2407
|
* ### .changes(function, object, property, [message])
|
|
2490
2408
|
*
|
|
@@ -2500,9 +2418,8 @@ assert.oneOf = function (inList, list, msg) {
|
|
|
2500
2418
|
* @param {String} property name _optional_
|
|
2501
2419
|
* @param {String} message _optional_
|
|
2502
2420
|
* @namespace Assert
|
|
2503
|
-
* @
|
|
2421
|
+
* @public
|
|
2504
2422
|
*/
|
|
2505
|
-
|
|
2506
2423
|
assert.changes = function (fn, obj, prop, msg) {
|
|
2507
2424
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
2508
2425
|
msg = prop;
|
|
@@ -2528,9 +2445,8 @@ assert.changes = function (fn, obj, prop, msg) {
|
|
|
2528
2445
|
* @param {Number} change amount (delta)
|
|
2529
2446
|
* @param {String} message _optional_
|
|
2530
2447
|
* @namespace Assert
|
|
2531
|
-
* @
|
|
2448
|
+
* @public
|
|
2532
2449
|
*/
|
|
2533
|
-
|
|
2534
2450
|
assert.changesBy = function (fn, obj, prop, delta, msg) {
|
|
2535
2451
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2536
2452
|
var tmpMsg = delta;
|
|
@@ -2560,9 +2476,8 @@ assert.changesBy = function (fn, obj, prop, delta, msg) {
|
|
|
2560
2476
|
* @param {String} property name _optional_
|
|
2561
2477
|
* @param {String} message _optional_
|
|
2562
2478
|
* @namespace Assert
|
|
2563
|
-
* @
|
|
2479
|
+
* @public
|
|
2564
2480
|
*/
|
|
2565
|
-
|
|
2566
2481
|
assert.doesNotChange = function (fn, obj, prop, msg) {
|
|
2567
2482
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
2568
2483
|
msg = prop;
|
|
@@ -2589,9 +2504,8 @@ assert.doesNotChange = function (fn, obj, prop, msg) {
|
|
|
2589
2504
|
* @param {Number} change amount (delta)
|
|
2590
2505
|
* @param {String} message _optional_
|
|
2591
2506
|
* @namespace Assert
|
|
2592
|
-
* @
|
|
2507
|
+
* @public
|
|
2593
2508
|
*/
|
|
2594
|
-
|
|
2595
2509
|
assert.changesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
2596
2510
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2597
2511
|
var tmpMsg = delta;
|
|
@@ -2621,9 +2535,8 @@ assert.changesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2621
2535
|
* @param {String} property name _optional_
|
|
2622
2536
|
* @param {String} message _optional_
|
|
2623
2537
|
* @namespace Assert
|
|
2624
|
-
* @
|
|
2538
|
+
* @public
|
|
2625
2539
|
*/
|
|
2626
|
-
|
|
2627
2540
|
assert.increases = function (fn, obj, prop, msg) {
|
|
2628
2541
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
2629
2542
|
msg = prop;
|
|
@@ -2650,9 +2563,8 @@ assert.increases = function (fn, obj, prop, msg) {
|
|
|
2650
2563
|
* @param {Number} change amount (delta)
|
|
2651
2564
|
* @param {String} message _optional_
|
|
2652
2565
|
* @namespace Assert
|
|
2653
|
-
* @
|
|
2566
|
+
* @public
|
|
2654
2567
|
*/
|
|
2655
|
-
|
|
2656
2568
|
assert.increasesBy = function (fn, obj, prop, delta, msg) {
|
|
2657
2569
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2658
2570
|
var tmpMsg = delta;
|
|
@@ -2682,9 +2594,8 @@ assert.increasesBy = function (fn, obj, prop, delta, msg) {
|
|
|
2682
2594
|
* @param {String} property name _optional_
|
|
2683
2595
|
* @param {String} message _optional_
|
|
2684
2596
|
* @namespace Assert
|
|
2685
|
-
* @
|
|
2597
|
+
* @public
|
|
2686
2598
|
*/
|
|
2687
|
-
|
|
2688
2599
|
assert.doesNotIncrease = function (fn, obj, prop, msg) {
|
|
2689
2600
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
2690
2601
|
msg = prop;
|
|
@@ -2711,9 +2622,8 @@ assert.doesNotIncrease = function (fn, obj, prop, msg) {
|
|
|
2711
2622
|
* @param {Number} change amount (delta)
|
|
2712
2623
|
* @param {String} message _optional_
|
|
2713
2624
|
* @namespace Assert
|
|
2714
|
-
* @
|
|
2625
|
+
* @public
|
|
2715
2626
|
*/
|
|
2716
|
-
|
|
2717
2627
|
assert.increasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
2718
2628
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2719
2629
|
var tmpMsg = delta;
|
|
@@ -2743,9 +2653,8 @@ assert.increasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2743
2653
|
* @param {String} property name _optional_
|
|
2744
2654
|
* @param {String} message _optional_
|
|
2745
2655
|
* @namespace Assert
|
|
2746
|
-
* @
|
|
2656
|
+
* @public
|
|
2747
2657
|
*/
|
|
2748
|
-
|
|
2749
2658
|
assert.decreases = function (fn, obj, prop, msg) {
|
|
2750
2659
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
2751
2660
|
msg = prop;
|
|
@@ -2772,9 +2681,8 @@ assert.decreases = function (fn, obj, prop, msg) {
|
|
|
2772
2681
|
* @param {Number} change amount (delta)
|
|
2773
2682
|
* @param {String} message _optional_
|
|
2774
2683
|
* @namespace Assert
|
|
2775
|
-
* @
|
|
2684
|
+
* @public
|
|
2776
2685
|
*/
|
|
2777
|
-
|
|
2778
2686
|
assert.decreasesBy = function (fn, obj, prop, delta, msg) {
|
|
2779
2687
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2780
2688
|
var tmpMsg = delta;
|
|
@@ -2804,9 +2712,8 @@ assert.decreasesBy = function (fn, obj, prop, delta, msg) {
|
|
|
2804
2712
|
* @param {String} property name _optional_
|
|
2805
2713
|
* @param {String} message _optional_
|
|
2806
2714
|
* @namespace Assert
|
|
2807
|
-
* @
|
|
2715
|
+
* @public
|
|
2808
2716
|
*/
|
|
2809
|
-
|
|
2810
2717
|
assert.doesNotDecrease = function (fn, obj, prop, msg) {
|
|
2811
2718
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
2812
2719
|
msg = prop;
|
|
@@ -2833,9 +2740,8 @@ assert.doesNotDecrease = function (fn, obj, prop, msg) {
|
|
|
2833
2740
|
* @param {Number} change amount (delta)
|
|
2834
2741
|
* @param {String} message _optional_
|
|
2835
2742
|
* @namespace Assert
|
|
2836
|
-
* @
|
|
2743
|
+
* @public
|
|
2837
2744
|
*/
|
|
2838
|
-
|
|
2839
2745
|
assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) {
|
|
2840
2746
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2841
2747
|
var tmpMsg = delta;
|
|
@@ -2866,9 +2772,8 @@ assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) {
|
|
|
2866
2772
|
* @param {Number} change amount (delta)
|
|
2867
2773
|
* @param {String} message _optional_
|
|
2868
2774
|
* @namespace Assert
|
|
2869
|
-
* @
|
|
2775
|
+
* @public
|
|
2870
2776
|
*/
|
|
2871
|
-
|
|
2872
2777
|
assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
2873
2778
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
2874
2779
|
var tmpMsg = delta;
|
|
@@ -2883,7 +2788,7 @@ assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2883
2788
|
.to.decrease(obj, prop).but.not.by(delta);
|
|
2884
2789
|
}
|
|
2885
2790
|
|
|
2886
|
-
|
|
2791
|
+
/**
|
|
2887
2792
|
* ### .ifError(object)
|
|
2888
2793
|
*
|
|
2889
2794
|
* Asserts if value is not a false value, and throws if it is a true value.
|
|
@@ -2896,9 +2801,8 @@ assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2896
2801
|
* @name ifError
|
|
2897
2802
|
* @param {Object} object
|
|
2898
2803
|
* @namespace Assert
|
|
2899
|
-
* @
|
|
2804
|
+
* @public
|
|
2900
2805
|
*/
|
|
2901
|
-
|
|
2902
2806
|
assert.ifError = function (val) {
|
|
2903
2807
|
if (val) {
|
|
2904
2808
|
throw(val);
|
|
@@ -2917,9 +2821,8 @@ assert.ifError = function (val) {
|
|
|
2917
2821
|
* @param {Object} object
|
|
2918
2822
|
* @param {String} message _optional_
|
|
2919
2823
|
* @namespace Assert
|
|
2920
|
-
* @
|
|
2824
|
+
* @public
|
|
2921
2825
|
*/
|
|
2922
|
-
|
|
2923
2826
|
assert.isExtensible = function (obj, msg) {
|
|
2924
2827
|
new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible;
|
|
2925
2828
|
};
|
|
@@ -2942,9 +2845,8 @@ assert.isExtensible = function (obj, msg) {
|
|
|
2942
2845
|
* @param {Object} object
|
|
2943
2846
|
* @param {String} message _optional_
|
|
2944
2847
|
* @namespace Assert
|
|
2945
|
-
* @
|
|
2848
|
+
* @public
|
|
2946
2849
|
*/
|
|
2947
|
-
|
|
2948
2850
|
assert.isNotExtensible = function (obj, msg) {
|
|
2949
2851
|
new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible;
|
|
2950
2852
|
};
|
|
@@ -2966,9 +2868,8 @@ assert.isNotExtensible = function (obj, msg) {
|
|
|
2966
2868
|
* @param {Object} object
|
|
2967
2869
|
* @param {String} message _optional_
|
|
2968
2870
|
* @namespace Assert
|
|
2969
|
-
* @
|
|
2871
|
+
* @public
|
|
2970
2872
|
*/
|
|
2971
|
-
|
|
2972
2873
|
assert.isSealed = function (obj, msg) {
|
|
2973
2874
|
new Assertion(obj, msg, assert.isSealed, true).to.be.sealed;
|
|
2974
2875
|
};
|
|
@@ -2985,9 +2886,8 @@ assert.isSealed = function (obj, msg) {
|
|
|
2985
2886
|
* @param {Object} object
|
|
2986
2887
|
* @param {String} message _optional_
|
|
2987
2888
|
* @namespace Assert
|
|
2988
|
-
* @
|
|
2889
|
+
* @public
|
|
2989
2890
|
*/
|
|
2990
|
-
|
|
2991
2891
|
assert.isNotSealed = function (obj, msg) {
|
|
2992
2892
|
new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed;
|
|
2993
2893
|
};
|
|
@@ -3006,9 +2906,8 @@ assert.isNotSealed = function (obj, msg) {
|
|
|
3006
2906
|
* @param {Object} object
|
|
3007
2907
|
* @param {String} message _optional_
|
|
3008
2908
|
* @namespace Assert
|
|
3009
|
-
* @
|
|
2909
|
+
* @public
|
|
3010
2910
|
*/
|
|
3011
|
-
|
|
3012
2911
|
assert.isFrozen = function (obj, msg) {
|
|
3013
2912
|
new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen;
|
|
3014
2913
|
};
|
|
@@ -3025,9 +2924,8 @@ assert.isFrozen = function (obj, msg) {
|
|
|
3025
2924
|
* @param {Object} object
|
|
3026
2925
|
* @param {String} message _optional_
|
|
3027
2926
|
* @namespace Assert
|
|
3028
|
-
* @
|
|
2927
|
+
* @public
|
|
3029
2928
|
*/
|
|
3030
|
-
|
|
3031
2929
|
assert.isNotFrozen = function (obj, msg) {
|
|
3032
2930
|
new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen;
|
|
3033
2931
|
};
|
|
@@ -3051,9 +2949,8 @@ assert.isNotFrozen = function (obj, msg) {
|
|
|
3051
2949
|
* @param {Object|Array|String|Map|Set} target
|
|
3052
2950
|
* @param {String} message _optional_
|
|
3053
2951
|
* @namespace Assert
|
|
3054
|
-
* @
|
|
2952
|
+
* @public
|
|
3055
2953
|
*/
|
|
3056
|
-
|
|
3057
2954
|
assert.isEmpty = function(val, msg) {
|
|
3058
2955
|
new Assertion(val, msg, assert.isEmpty, true).to.be.empty;
|
|
3059
2956
|
};
|
|
@@ -3077,17 +2974,15 @@ assert.isEmpty = function(val, msg) {
|
|
|
3077
2974
|
* @param {Object|Array|String|Map|Set} target
|
|
3078
2975
|
* @param {String} message _optional_
|
|
3079
2976
|
* @namespace Assert
|
|
3080
|
-
* @
|
|
2977
|
+
* @public
|
|
3081
2978
|
*/
|
|
3082
|
-
|
|
3083
2979
|
assert.isNotEmpty = function(val, msg) {
|
|
3084
2980
|
new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty;
|
|
3085
2981
|
};
|
|
3086
2982
|
|
|
3087
|
-
|
|
2983
|
+
/**
|
|
3088
2984
|
* Aliases.
|
|
3089
2985
|
*/
|
|
3090
|
-
|
|
3091
2986
|
(function alias(name, as){
|
|
3092
2987
|
assert[as] = assert[name];
|
|
3093
2988
|
return alias;
|