chai 5.1.0 → 5.1.2
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/README.md +3 -3
- package/chai.js +138 -79
- package/eslint.config.js +12 -0
- package/lib/chai/assertion.js +28 -28
- package/lib/chai/config.js +18 -24
- package/lib/chai/core/assertions.js +252 -255
- package/lib/chai/interface/assert.js +438 -390
- package/lib/chai/interface/expect.js +7 -2
- package/lib/chai/interface/should.js +30 -20
- package/lib/chai/utils/addChainableMethod.js +5 -6
- package/lib/chai/utils/addLengthGuard.js +3 -3
- package/lib/chai/utils/addMethod.js +5 -6
- package/lib/chai/utils/addProperty.js +5 -6
- package/lib/chai/utils/compareByInspect.js +4 -5
- package/lib/chai/utils/expectTypes.js +7 -8
- package/lib/chai/utils/flag.js +5 -5
- package/lib/chai/utils/getActual.js +3 -3
- package/lib/chai/utils/getEnumerableProperties.js +2 -3
- package/lib/chai/utils/getMessage.js +4 -4
- package/lib/chai/utils/getOperator.js +8 -4
- package/lib/chai/utils/getOwnEnumerableProperties.js +2 -3
- package/lib/chai/utils/getOwnEnumerablePropertySymbols.js +2 -3
- package/lib/chai/utils/getProperties.js +5 -3
- package/lib/chai/utils/index.js +23 -2
- package/lib/chai/utils/inspect.js +5 -4
- package/lib/chai/utils/isNaN.js +3 -3
- package/lib/chai/utils/isProxyEnabled.js +1 -1
- package/lib/chai/utils/objDisplay.js +2 -3
- package/lib/chai/utils/overwriteChainableMethod.js +7 -8
- package/lib/chai/utils/overwriteMethod.js +10 -11
- package/lib/chai/utils/overwriteProperty.js +10 -12
- package/lib/chai/utils/proxify.js +9 -9
- package/lib/chai/utils/test.js +3 -3
- package/lib/chai/utils/transferFlags.js +4 -6
- package/lib/chai/utils/type-detect.js +4 -0
- package/lib/chai.js +2 -2
- package/package.json +6 -3
- package/web-test-runner.config.js +4 -1
|
@@ -17,13 +17,13 @@ import {AssertionError} from 'assertion-error';
|
|
|
17
17
|
* assert('foo' !== 'bar', 'foo is not bar');
|
|
18
18
|
* assert(Array.isArray([]), 'empty arrays are arrays');
|
|
19
19
|
*
|
|
20
|
-
* @param {unknown} expression to test for truthiness
|
|
21
|
-
* @param {
|
|
20
|
+
* @param {unknown} express - expression to test for truthiness
|
|
21
|
+
* @param {string} errmsg - message to display on error
|
|
22
22
|
* @name assert
|
|
23
23
|
* @namespace Assert
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
function assert(express, errmsg) {
|
|
26
|
+
export function assert(express, errmsg) {
|
|
27
27
|
var test = new Assertion(null, null, chai.assert, true);
|
|
28
28
|
test.assert(
|
|
29
29
|
express
|
|
@@ -32,8 +32,6 @@ function assert(express, errmsg) {
|
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export {assert};
|
|
36
|
-
|
|
37
35
|
/**
|
|
38
36
|
* ### .fail([message])
|
|
39
37
|
* ### .fail(actual, expected, [message], [operator])
|
|
@@ -50,8 +48,8 @@ export {assert};
|
|
|
50
48
|
* @name fail
|
|
51
49
|
* @param {unknown} actual
|
|
52
50
|
* @param {unknown} expected
|
|
53
|
-
* @param {
|
|
54
|
-
* @param {
|
|
51
|
+
* @param {string} message
|
|
52
|
+
* @param {string} operator
|
|
55
53
|
* @namespace Assert
|
|
56
54
|
* @public
|
|
57
55
|
*/
|
|
@@ -81,8 +79,8 @@ assert.fail = function (actual, expected, message, operator) {
|
|
|
81
79
|
*
|
|
82
80
|
* @name isOk
|
|
83
81
|
* @alias ok
|
|
84
|
-
* @param {unknown} object to test
|
|
85
|
-
* @param {
|
|
82
|
+
* @param {unknown} val object to test
|
|
83
|
+
* @param {string} msg
|
|
86
84
|
* @namespace Assert
|
|
87
85
|
* @public
|
|
88
86
|
*/
|
|
@@ -100,8 +98,8 @@ assert.isOk = function (val, msg) {
|
|
|
100
98
|
*
|
|
101
99
|
* @name isNotOk
|
|
102
100
|
* @alias notOk
|
|
103
|
-
* @param {unknown} object to test
|
|
104
|
-
* @param {
|
|
101
|
+
* @param {unknown} val object to test
|
|
102
|
+
* @param {string} msg
|
|
105
103
|
* @namespace Assert
|
|
106
104
|
* @public
|
|
107
105
|
*/
|
|
@@ -117,9 +115,9 @@ assert.isNotOk = function (val, msg) {
|
|
|
117
115
|
* assert.equal(3, '3', '== coerces values to strings');
|
|
118
116
|
*
|
|
119
117
|
* @name equal
|
|
120
|
-
* @param {unknown}
|
|
121
|
-
* @param {unknown}
|
|
122
|
-
* @param {
|
|
118
|
+
* @param {unknown} act
|
|
119
|
+
* @param {unknown} exp
|
|
120
|
+
* @param {string} msg
|
|
123
121
|
* @namespace Assert
|
|
124
122
|
* @public
|
|
125
123
|
*/
|
|
@@ -144,9 +142,9 @@ assert.equal = function (act, exp, msg) {
|
|
|
144
142
|
* assert.notEqual(3, 4, 'these numbers are not equal');
|
|
145
143
|
*
|
|
146
144
|
* @name notEqual
|
|
147
|
-
* @param {unknown}
|
|
148
|
-
* @param {unknown}
|
|
149
|
-
* @param {
|
|
145
|
+
* @param {unknown} act
|
|
146
|
+
* @param {unknown} exp
|
|
147
|
+
* @param {string} msg
|
|
150
148
|
* @namespace Assert
|
|
151
149
|
* @public
|
|
152
150
|
*/
|
|
@@ -171,9 +169,9 @@ assert.notEqual = function (act, exp, msg) {
|
|
|
171
169
|
* assert.strictEqual(true, true, 'these booleans are strictly equal');
|
|
172
170
|
*
|
|
173
171
|
* @name strictEqual
|
|
174
|
-
* @param {unknown}
|
|
175
|
-
* @param {unknown}
|
|
176
|
-
* @param {
|
|
172
|
+
* @param {unknown} act
|
|
173
|
+
* @param {unknown} exp
|
|
174
|
+
* @param {string} msg
|
|
177
175
|
* @namespace Assert
|
|
178
176
|
* @public
|
|
179
177
|
*/
|
|
@@ -189,9 +187,9 @@ assert.strictEqual = function (act, exp, msg) {
|
|
|
189
187
|
* assert.notStrictEqual(3, '3', 'no coercion for strict equality');
|
|
190
188
|
*
|
|
191
189
|
* @name notStrictEqual
|
|
192
|
-
* @param {unknown}
|
|
193
|
-
* @param {unknown}
|
|
194
|
-
* @param {
|
|
190
|
+
* @param {unknown} act
|
|
191
|
+
* @param {unknown} exp
|
|
192
|
+
* @param {string} msg
|
|
195
193
|
* @namespace Assert
|
|
196
194
|
* @public
|
|
197
195
|
*/
|
|
@@ -207,9 +205,9 @@ assert.notStrictEqual = function (act, exp, msg) {
|
|
|
207
205
|
* assert.deepEqual({ tea: 'green' }, { tea: 'green' });
|
|
208
206
|
*
|
|
209
207
|
* @name deepEqual
|
|
210
|
-
* @param {unknown}
|
|
211
|
-
* @param {unknown}
|
|
212
|
-
* @param {
|
|
208
|
+
* @param {unknown} act
|
|
209
|
+
* @param {unknown} exp
|
|
210
|
+
* @param {string} msg
|
|
213
211
|
* @alias deepStrictEqual
|
|
214
212
|
* @namespace Assert
|
|
215
213
|
* @public
|
|
@@ -226,9 +224,9 @@ assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) {
|
|
|
226
224
|
* assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
|
|
227
225
|
*
|
|
228
226
|
* @name notDeepEqual
|
|
229
|
-
* @param {unknown}
|
|
230
|
-
* @param {unknown}
|
|
231
|
-
* @param {
|
|
227
|
+
* @param {unknown} act
|
|
228
|
+
* @param {unknown} exp
|
|
229
|
+
* @param {string} msg
|
|
232
230
|
* @namespace Assert
|
|
233
231
|
* @public
|
|
234
232
|
*/
|
|
@@ -236,7 +234,7 @@ assert.notDeepEqual = function (act, exp, msg) {
|
|
|
236
234
|
new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp);
|
|
237
235
|
};
|
|
238
236
|
|
|
239
|
-
|
|
237
|
+
/**
|
|
240
238
|
* ### .isAbove(valueToCheck, valueToBeAbove, [message])
|
|
241
239
|
*
|
|
242
240
|
* Asserts `valueToCheck` is strictly greater than (>) `valueToBeAbove`.
|
|
@@ -244,9 +242,9 @@ assert.notDeepEqual = function (act, exp, msg) {
|
|
|
244
242
|
* assert.isAbove(5, 2, '5 is strictly greater than 2');
|
|
245
243
|
*
|
|
246
244
|
* @name isAbove
|
|
247
|
-
* @param {unknown}
|
|
248
|
-
* @param {unknown}
|
|
249
|
-
* @param {
|
|
245
|
+
* @param {unknown} val
|
|
246
|
+
* @param {unknown} abv
|
|
247
|
+
* @param {string} msg
|
|
250
248
|
* @namespace Assert
|
|
251
249
|
* @public
|
|
252
250
|
*/
|
|
@@ -254,7 +252,7 @@ assert.isAbove = function (val, abv, msg) {
|
|
|
254
252
|
new Assertion(val, msg, assert.isAbove, true).to.be.above(abv);
|
|
255
253
|
};
|
|
256
254
|
|
|
257
|
-
|
|
255
|
+
/**
|
|
258
256
|
* ### .isAtLeast(valueToCheck, valueToBeAtLeast, [message])
|
|
259
257
|
*
|
|
260
258
|
* Asserts `valueToCheck` is greater than or equal to (>=) `valueToBeAtLeast`.
|
|
@@ -263,9 +261,9 @@ assert.isAbove = function (val, abv, msg) {
|
|
|
263
261
|
* assert.isAtLeast(3, 3, '3 is greater or equal to 3');
|
|
264
262
|
*
|
|
265
263
|
* @name isAtLeast
|
|
266
|
-
* @param {unknown}
|
|
267
|
-
* @param {unknown}
|
|
268
|
-
* @param {
|
|
264
|
+
* @param {unknown} val
|
|
265
|
+
* @param {unknown} atlst
|
|
266
|
+
* @param {string} msg
|
|
269
267
|
* @namespace Assert
|
|
270
268
|
* @public
|
|
271
269
|
*/
|
|
@@ -273,7 +271,7 @@ assert.isAtLeast = function (val, atlst, msg) {
|
|
|
273
271
|
new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst);
|
|
274
272
|
};
|
|
275
273
|
|
|
276
|
-
|
|
274
|
+
/**
|
|
277
275
|
* ### .isBelow(valueToCheck, valueToBeBelow, [message])
|
|
278
276
|
*
|
|
279
277
|
* Asserts `valueToCheck` is strictly less than (<) `valueToBeBelow`.
|
|
@@ -281,9 +279,9 @@ assert.isAtLeast = function (val, atlst, msg) {
|
|
|
281
279
|
* assert.isBelow(3, 6, '3 is strictly less than 6');
|
|
282
280
|
*
|
|
283
281
|
* @name isBelow
|
|
284
|
-
* @param {unknown}
|
|
285
|
-
* @param {unknown}
|
|
286
|
-
* @param {
|
|
282
|
+
* @param {unknown} val
|
|
283
|
+
* @param {unknown} blw
|
|
284
|
+
* @param {string} msg
|
|
287
285
|
* @namespace Assert
|
|
288
286
|
* @public
|
|
289
287
|
*/
|
|
@@ -291,7 +289,7 @@ assert.isBelow = function (val, blw, msg) {
|
|
|
291
289
|
new Assertion(val, msg, assert.isBelow, true).to.be.below(blw);
|
|
292
290
|
};
|
|
293
291
|
|
|
294
|
-
|
|
292
|
+
/**
|
|
295
293
|
* ### .isAtMost(valueToCheck, valueToBeAtMost, [message])
|
|
296
294
|
*
|
|
297
295
|
* Asserts `valueToCheck` is less than or equal to (<=) `valueToBeAtMost`.
|
|
@@ -300,9 +298,9 @@ assert.isBelow = function (val, blw, msg) {
|
|
|
300
298
|
* assert.isAtMost(4, 4, '4 is less than or equal to 4');
|
|
301
299
|
*
|
|
302
300
|
* @name isAtMost
|
|
303
|
-
* @param {unknown}
|
|
304
|
-
* @param {unknown}
|
|
305
|
-
* @param {
|
|
301
|
+
* @param {unknown} val
|
|
302
|
+
* @param {unknown} atmst
|
|
303
|
+
* @param {string} msg
|
|
306
304
|
* @namespace Assert
|
|
307
305
|
* @public
|
|
308
306
|
*/
|
|
@@ -319,8 +317,8 @@ assert.isAtMost = function (val, atmst, msg) {
|
|
|
319
317
|
* assert.isTrue(teaServed, 'the tea has been served');
|
|
320
318
|
*
|
|
321
319
|
* @name isTrue
|
|
322
|
-
* @param {unknown}
|
|
323
|
-
* @param {
|
|
320
|
+
* @param {unknown} val
|
|
321
|
+
* @param {string} msg
|
|
324
322
|
* @namespace Assert
|
|
325
323
|
* @public
|
|
326
324
|
*/
|
|
@@ -337,8 +335,8 @@ assert.isTrue = function (val, msg) {
|
|
|
337
335
|
* assert.isNotTrue(tea, 'great, time for tea!');
|
|
338
336
|
*
|
|
339
337
|
* @name isNotTrue
|
|
340
|
-
* @param {unknown}
|
|
341
|
-
* @param {
|
|
338
|
+
* @param {unknown} val
|
|
339
|
+
* @param {string} msg
|
|
342
340
|
* @namespace Assert
|
|
343
341
|
* @public
|
|
344
342
|
*/
|
|
@@ -355,8 +353,8 @@ assert.isNotTrue = function (val, msg) {
|
|
|
355
353
|
* assert.isFalse(teaServed, 'no tea yet? hmm...');
|
|
356
354
|
*
|
|
357
355
|
* @name isFalse
|
|
358
|
-
* @param {unknown}
|
|
359
|
-
* @param {
|
|
356
|
+
* @param {unknown} val
|
|
357
|
+
* @param {string} msg
|
|
360
358
|
* @namespace Assert
|
|
361
359
|
* @public
|
|
362
360
|
*/
|
|
@@ -373,8 +371,8 @@ assert.isFalse = function (val, msg) {
|
|
|
373
371
|
* assert.isNotFalse(tea, 'great, time for tea!');
|
|
374
372
|
*
|
|
375
373
|
* @name isNotFalse
|
|
376
|
-
* @param {unknown}
|
|
377
|
-
* @param {
|
|
374
|
+
* @param {unknown} val
|
|
375
|
+
* @param {string} msg
|
|
378
376
|
* @namespace Assert
|
|
379
377
|
* @public
|
|
380
378
|
*/
|
|
@@ -390,8 +388,8 @@ assert.isNotFalse = function (val, msg) {
|
|
|
390
388
|
* assert.isNull(err, 'there was no error');
|
|
391
389
|
*
|
|
392
390
|
* @name isNull
|
|
393
|
-
* @param {unknown}
|
|
394
|
-
* @param {
|
|
391
|
+
* @param {unknown} val
|
|
392
|
+
* @param {string} msg
|
|
395
393
|
* @namespace Assert
|
|
396
394
|
* @public
|
|
397
395
|
*/
|
|
@@ -408,8 +406,8 @@ assert.isNull = function (val, msg) {
|
|
|
408
406
|
* assert.isNotNull(tea, 'great, time for tea!');
|
|
409
407
|
*
|
|
410
408
|
* @name isNotNull
|
|
411
|
-
* @param {unknown}
|
|
412
|
-
* @param {
|
|
409
|
+
* @param {unknown} val
|
|
410
|
+
* @param {string} msg
|
|
413
411
|
* @namespace Assert
|
|
414
412
|
* @public
|
|
415
413
|
*/
|
|
@@ -425,8 +423,8 @@ assert.isNotNull = function (val, msg) {
|
|
|
425
423
|
* assert.isNaN(NaN, 'NaN is NaN');
|
|
426
424
|
*
|
|
427
425
|
* @name isNaN
|
|
428
|
-
* @param {unknown}
|
|
429
|
-
* @param {
|
|
426
|
+
* @param {unknown} val
|
|
427
|
+
* @param {string} msg
|
|
430
428
|
* @namespace Assert
|
|
431
429
|
* @public
|
|
432
430
|
*/
|
|
@@ -443,11 +441,12 @@ assert.isNaN = function (val, msg) {
|
|
|
443
441
|
*
|
|
444
442
|
* @name isNotNaN
|
|
445
443
|
* @param {unknown} value
|
|
446
|
-
* @param {
|
|
444
|
+
* @param {string} message
|
|
447
445
|
* @namespace Assert
|
|
448
446
|
* @public
|
|
449
|
-
*/
|
|
450
|
-
|
|
447
|
+
*/
|
|
448
|
+
assert.isNotNaN = function (value, message) {
|
|
449
|
+
new Assertion(value, message, assert.isNotNaN, true).not.to.be.NaN;
|
|
451
450
|
};
|
|
452
451
|
|
|
453
452
|
/**
|
|
@@ -456,12 +455,11 @@ assert.isNaN = function (val, msg) {
|
|
|
456
455
|
* Asserts that the target is neither `null` nor `undefined`.
|
|
457
456
|
*
|
|
458
457
|
* var foo = 'hi';
|
|
459
|
-
*
|
|
460
458
|
* assert.exists(foo, 'foo is neither `null` nor `undefined`');
|
|
461
459
|
*
|
|
462
460
|
* @name exists
|
|
463
|
-
* @param {unknown}
|
|
464
|
-
* @param {
|
|
461
|
+
* @param {unknown} val
|
|
462
|
+
* @param {string} msg
|
|
465
463
|
* @namespace Assert
|
|
466
464
|
* @public
|
|
467
465
|
*/
|
|
@@ -475,14 +473,14 @@ assert.exists = function (val, msg) {
|
|
|
475
473
|
* Asserts that the target is either `null` or `undefined`.
|
|
476
474
|
*
|
|
477
475
|
* var bar = null
|
|
478
|
-
*
|
|
476
|
+
* , baz;
|
|
479
477
|
*
|
|
480
478
|
* assert.notExists(bar);
|
|
481
479
|
* assert.notExists(baz, 'baz is either null or undefined');
|
|
482
480
|
*
|
|
483
481
|
* @name notExists
|
|
484
|
-
* @param {unknown}
|
|
485
|
-
* @param {
|
|
482
|
+
* @param {unknown} val
|
|
483
|
+
* @param {string} msg
|
|
486
484
|
* @namespace Assert
|
|
487
485
|
* @public
|
|
488
486
|
*/
|
|
@@ -499,8 +497,8 @@ assert.notExists = function (val, msg) {
|
|
|
499
497
|
* assert.isUndefined(tea, 'no tea defined');
|
|
500
498
|
*
|
|
501
499
|
* @name isUndefined
|
|
502
|
-
* @param {unknown}
|
|
503
|
-
* @param {
|
|
500
|
+
* @param {unknown} val
|
|
501
|
+
* @param {string} msg
|
|
504
502
|
* @namespace Assert
|
|
505
503
|
* @public
|
|
506
504
|
*/
|
|
@@ -517,8 +515,8 @@ assert.isUndefined = function (val, msg) {
|
|
|
517
515
|
* assert.isDefined(tea, 'tea has been defined');
|
|
518
516
|
*
|
|
519
517
|
* @name isDefined
|
|
520
|
-
* @param {unknown}
|
|
521
|
-
* @param {
|
|
518
|
+
* @param {unknown} val
|
|
519
|
+
* @param {string} msg
|
|
522
520
|
* @namespace Assert
|
|
523
521
|
* @public
|
|
524
522
|
*/
|
|
@@ -536,11 +534,12 @@ assert.isDefined = function (val, msg) {
|
|
|
536
534
|
*
|
|
537
535
|
* @name isCallable
|
|
538
536
|
* @param {unknown} value
|
|
539
|
-
* @param {
|
|
537
|
+
* @param {string} message
|
|
540
538
|
* @namespace Assert
|
|
541
539
|
* @public
|
|
542
|
-
*/
|
|
543
|
-
|
|
540
|
+
*/
|
|
541
|
+
assert.isCallable = function (value, message) {
|
|
542
|
+
new Assertion(value, message, assert.isCallable, true).is.callable;
|
|
544
543
|
}
|
|
545
544
|
|
|
546
545
|
/**
|
|
@@ -553,11 +552,12 @@ assert.isDefined = function (val, msg) {
|
|
|
553
552
|
*
|
|
554
553
|
* @name isNotCallable
|
|
555
554
|
* @param {unknown} value
|
|
556
|
-
* @param {
|
|
555
|
+
* @param {string} message
|
|
557
556
|
* @namespace Assert
|
|
558
557
|
* @public
|
|
559
|
-
*/
|
|
560
|
-
|
|
558
|
+
*/
|
|
559
|
+
assert.isNotCallable = function (value, message) {
|
|
560
|
+
new Assertion(value, message, assert.isNotCallable, true).is.not.callable;
|
|
561
561
|
};
|
|
562
562
|
|
|
563
563
|
/**
|
|
@@ -570,8 +570,8 @@ assert.isDefined = function (val, msg) {
|
|
|
570
570
|
* assert.isObject(selection, 'tea selection is an object');
|
|
571
571
|
*
|
|
572
572
|
* @name isObject
|
|
573
|
-
* @param {unknown}
|
|
574
|
-
* @param {
|
|
573
|
+
* @param {unknown} val
|
|
574
|
+
* @param {string} msg
|
|
575
575
|
* @namespace Assert
|
|
576
576
|
* @public
|
|
577
577
|
*/
|
|
@@ -589,8 +589,8 @@ assert.isObject = function (val, msg) {
|
|
|
589
589
|
* assert.isNotObject(null, 'null is not an object');
|
|
590
590
|
*
|
|
591
591
|
* @name isNotObject
|
|
592
|
-
* @param {unknown}
|
|
593
|
-
* @param {
|
|
592
|
+
* @param {unknown} val
|
|
593
|
+
* @param {string} msg
|
|
594
594
|
* @namespace Assert
|
|
595
595
|
* @public
|
|
596
596
|
*/
|
|
@@ -607,8 +607,8 @@ assert.isNotObject = function (val, msg) {
|
|
|
607
607
|
* assert.isArray(menu, 'what kind of tea do we want?');
|
|
608
608
|
*
|
|
609
609
|
* @name isArray
|
|
610
|
-
* @param {unknown}
|
|
611
|
-
* @param {
|
|
610
|
+
* @param {unknown} val
|
|
611
|
+
* @param {string} msg
|
|
612
612
|
* @namespace Assert
|
|
613
613
|
* @public
|
|
614
614
|
*/
|
|
@@ -625,8 +625,8 @@ assert.isArray = function (val, msg) {
|
|
|
625
625
|
* assert.isNotArray(menu, 'what kind of tea do we want?');
|
|
626
626
|
*
|
|
627
627
|
* @name isNotArray
|
|
628
|
-
* @param {unknown}
|
|
629
|
-
* @param {
|
|
628
|
+
* @param {unknown} val
|
|
629
|
+
* @param {string} msg
|
|
630
630
|
* @namespace Assert
|
|
631
631
|
* @public
|
|
632
632
|
*/
|
|
@@ -643,8 +643,8 @@ assert.isNotArray = function (val, msg) {
|
|
|
643
643
|
* assert.isString(teaOrder, 'order placed');
|
|
644
644
|
*
|
|
645
645
|
* @name isString
|
|
646
|
-
* @param {unknown}
|
|
647
|
-
* @param {
|
|
646
|
+
* @param {unknown} val
|
|
647
|
+
* @param {string} msg
|
|
648
648
|
* @namespace Assert
|
|
649
649
|
* @public
|
|
650
650
|
*/
|
|
@@ -661,8 +661,8 @@ assert.isString = function (val, msg) {
|
|
|
661
661
|
* assert.isNotString(teaOrder, 'order placed');
|
|
662
662
|
*
|
|
663
663
|
* @name isNotString
|
|
664
|
-
* @param {unknown}
|
|
665
|
-
* @param {
|
|
664
|
+
* @param {unknown} val
|
|
665
|
+
* @param {string} msg
|
|
666
666
|
* @namespace Assert
|
|
667
667
|
* @public
|
|
668
668
|
*/
|
|
@@ -679,8 +679,8 @@ assert.isNotString = function (val, msg) {
|
|
|
679
679
|
* assert.isNumber(cups, 'how many cups');
|
|
680
680
|
*
|
|
681
681
|
* @name isNumber
|
|
682
|
-
* @param {
|
|
683
|
-
* @param {
|
|
682
|
+
* @param {number} val
|
|
683
|
+
* @param {string} msg
|
|
684
684
|
* @namespace Assert
|
|
685
685
|
* @public
|
|
686
686
|
*/
|
|
@@ -697,8 +697,8 @@ assert.isNumber = function (val, msg) {
|
|
|
697
697
|
* assert.isNotNumber(cups, 'how many cups');
|
|
698
698
|
*
|
|
699
699
|
* @name isNotNumber
|
|
700
|
-
* @param {unknown}
|
|
701
|
-
* @param {
|
|
700
|
+
* @param {unknown} val
|
|
701
|
+
* @param {string} msg
|
|
702
702
|
* @namespace Assert
|
|
703
703
|
* @public
|
|
704
704
|
*/
|
|
@@ -706,22 +706,60 @@ assert.isNotNumber = function (val, msg) {
|
|
|
706
706
|
new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a('number');
|
|
707
707
|
};
|
|
708
708
|
|
|
709
|
-
|
|
710
|
-
* ### .
|
|
709
|
+
/**
|
|
710
|
+
* ### .isNumeric(value, [message])
|
|
711
711
|
*
|
|
712
|
-
* Asserts that `value` is a
|
|
712
|
+
* Asserts that `value` is a number or BigInt.
|
|
713
713
|
*
|
|
714
714
|
* var cups = 2;
|
|
715
|
-
* assert.
|
|
715
|
+
* assert.isNumeric(cups, 'how many cups');
|
|
716
|
+
*
|
|
717
|
+
* var cups = 10n;
|
|
718
|
+
* assert.isNumeric(cups, 'how many cups');
|
|
719
|
+
*
|
|
720
|
+
* @name isNumeric
|
|
721
|
+
* @param {unknown} val
|
|
722
|
+
* @param {string} msg
|
|
723
|
+
* @namespace Assert
|
|
724
|
+
* @public
|
|
725
|
+
*/
|
|
726
|
+
assert.isNumeric = function (val, msg) {
|
|
727
|
+
new Assertion(val, msg, assert.isNumeric, true).is.numeric;
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* ### .isNotNumeric(value, [message])
|
|
716
732
|
*
|
|
717
|
-
*
|
|
733
|
+
* Asserts that `value` is _not_ a number or BigInt.
|
|
718
734
|
*
|
|
719
|
-
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
735
|
+
* var cups = '2 cups please';
|
|
736
|
+
* assert.isNotNumeric(cups, 'how many cups');
|
|
737
|
+
*
|
|
738
|
+
* @name isNotNumeric
|
|
739
|
+
* @param {unknown} val
|
|
740
|
+
* @param {string} msg
|
|
722
741
|
* @namespace Assert
|
|
723
742
|
* @public
|
|
724
743
|
*/
|
|
744
|
+
assert.isNotNumeric = function (val, msg) {
|
|
745
|
+
new Assertion(val, msg, assert.isNotNumeric, true).is.not.numeric;
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* ### .isFinite(value, [message])
|
|
750
|
+
*
|
|
751
|
+
* Asserts that `value` is a finite number. Unlike `.isNumber`, this will fail for `NaN` and `Infinity`.
|
|
752
|
+
*
|
|
753
|
+
* var cups = 2;
|
|
754
|
+
* assert.isFinite(cups, 'how many cups');
|
|
755
|
+
* assert.isFinite(NaN); // throws
|
|
756
|
+
*
|
|
757
|
+
* @name isFinite
|
|
758
|
+
* @param {number} val
|
|
759
|
+
* @param {string} msg
|
|
760
|
+
* @namespace Assert
|
|
761
|
+
* @public
|
|
762
|
+
*/
|
|
725
763
|
assert.isFinite = function (val, msg) {
|
|
726
764
|
new Assertion(val, msg, assert.isFinite, true).to.be.finite;
|
|
727
765
|
};
|
|
@@ -732,14 +770,14 @@ assert.isFinite = function (val, msg) {
|
|
|
732
770
|
* Asserts that `value` is a boolean.
|
|
733
771
|
*
|
|
734
772
|
* var teaReady = true
|
|
735
|
-
*
|
|
773
|
+
* , teaServed = false;
|
|
736
774
|
*
|
|
737
775
|
* assert.isBoolean(teaReady, 'is the tea ready');
|
|
738
776
|
* assert.isBoolean(teaServed, 'has tea been served');
|
|
739
777
|
*
|
|
740
778
|
* @name isBoolean
|
|
741
|
-
* @param {unknown}
|
|
742
|
-
* @param {
|
|
779
|
+
* @param {unknown} val
|
|
780
|
+
* @param {string} msg
|
|
743
781
|
* @namespace Assert
|
|
744
782
|
* @public
|
|
745
783
|
*/
|
|
@@ -753,14 +791,14 @@ assert.isBoolean = function (val, msg) {
|
|
|
753
791
|
* Asserts that `value` is _not_ a boolean.
|
|
754
792
|
*
|
|
755
793
|
* var teaReady = 'yep'
|
|
756
|
-
*
|
|
794
|
+
* , teaServed = 'nope';
|
|
757
795
|
*
|
|
758
796
|
* assert.isNotBoolean(teaReady, 'is the tea ready');
|
|
759
797
|
* assert.isNotBoolean(teaServed, 'has tea been served');
|
|
760
798
|
*
|
|
761
799
|
* @name isNotBoolean
|
|
762
|
-
* @param {unknown}
|
|
763
|
-
* @param {
|
|
800
|
+
* @param {unknown} val
|
|
801
|
+
* @param {string} msg
|
|
764
802
|
* @namespace Assert
|
|
765
803
|
* @public
|
|
766
804
|
*/
|
|
@@ -782,9 +820,9 @@ assert.isNotBoolean = function (val, msg) {
|
|
|
782
820
|
* assert.typeOf(undefined, 'undefined', 'we have an undefined');
|
|
783
821
|
*
|
|
784
822
|
* @name typeOf
|
|
785
|
-
* @param {unknown}
|
|
786
|
-
* @param {
|
|
787
|
-
* @param {
|
|
823
|
+
* @param {unknown} val
|
|
824
|
+
* @param {string} type
|
|
825
|
+
* @param {string} msg
|
|
788
826
|
* @namespace Assert
|
|
789
827
|
* @public
|
|
790
828
|
*/
|
|
@@ -802,13 +840,13 @@ assert.typeOf = function (val, type, msg) {
|
|
|
802
840
|
*
|
|
803
841
|
* @name notTypeOf
|
|
804
842
|
* @param {unknown} value
|
|
805
|
-
* @param {
|
|
806
|
-
* @param {
|
|
843
|
+
* @param {string} type
|
|
844
|
+
* @param {string} message
|
|
807
845
|
* @namespace Assert
|
|
808
846
|
* @public
|
|
809
847
|
*/
|
|
810
|
-
assert.notTypeOf = function (
|
|
811
|
-
new Assertion(
|
|
848
|
+
assert.notTypeOf = function (value, type, message) {
|
|
849
|
+
new Assertion(value, message, assert.notTypeOf, true).to.not.be.a(type);
|
|
812
850
|
};
|
|
813
851
|
|
|
814
852
|
/**
|
|
@@ -817,14 +855,14 @@ assert.notTypeOf = function (val, type, msg) {
|
|
|
817
855
|
* Asserts that `value` is an instance of `constructor`.
|
|
818
856
|
*
|
|
819
857
|
* var Tea = function (name) { this.name = name; }
|
|
820
|
-
*
|
|
858
|
+
* , chai = new Tea('chai');
|
|
821
859
|
*
|
|
822
860
|
* assert.instanceOf(chai, Tea, 'chai is an instance of tea');
|
|
823
861
|
*
|
|
824
862
|
* @name instanceOf
|
|
825
|
-
* @param {
|
|
826
|
-
* @param {
|
|
827
|
-
* @param {
|
|
863
|
+
* @param {object} val
|
|
864
|
+
* @param {object} type
|
|
865
|
+
* @param {string} msg
|
|
828
866
|
* @namespace Assert
|
|
829
867
|
* @public
|
|
830
868
|
*/
|
|
@@ -838,14 +876,14 @@ assert.instanceOf = function (val, type, msg) {
|
|
|
838
876
|
* Asserts `value` is not an instance of `constructor`.
|
|
839
877
|
*
|
|
840
878
|
* var Tea = function (name) { this.name = name; }
|
|
841
|
-
*
|
|
879
|
+
* , chai = new String('chai');
|
|
842
880
|
*
|
|
843
881
|
* assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea');
|
|
844
882
|
*
|
|
845
883
|
* @name notInstanceOf
|
|
846
|
-
* @param {
|
|
847
|
-
* @param {
|
|
848
|
-
* @param {
|
|
884
|
+
* @param {object} val
|
|
885
|
+
* @param {object} type
|
|
886
|
+
* @param {string} msg
|
|
849
887
|
* @namespace Assert
|
|
850
888
|
* @public
|
|
851
889
|
*/
|
|
@@ -872,15 +910,15 @@ assert.notInstanceOf = function (val, type, msg) {
|
|
|
872
910
|
* and strictly equal to the given property value. For instance:
|
|
873
911
|
*
|
|
874
912
|
* var obj1 = {a: 1}
|
|
875
|
-
*
|
|
913
|
+
* , obj2 = {b: 2};
|
|
876
914
|
* assert.include([obj1, obj2], obj1);
|
|
877
915
|
* assert.include({foo: obj1, bar: obj2}, {foo: obj1});
|
|
878
916
|
* assert.include({foo: obj1, bar: obj2}, {foo: obj1, bar: obj2});
|
|
879
917
|
*
|
|
880
918
|
* @name include
|
|
881
|
-
* @param {Array|
|
|
882
|
-
* @param {unknown}
|
|
883
|
-
* @param {
|
|
919
|
+
* @param {Array | string} exp
|
|
920
|
+
* @param {unknown} inc
|
|
921
|
+
* @param {string} msg
|
|
884
922
|
* @namespace Assert
|
|
885
923
|
* @public
|
|
886
924
|
*/
|
|
@@ -907,15 +945,15 @@ assert.include = function (exp, inc, msg) {
|
|
|
907
945
|
* property value. For instance:
|
|
908
946
|
*
|
|
909
947
|
* var obj1 = {a: 1}
|
|
910
|
-
*
|
|
948
|
+
* , obj2 = {b: 2};
|
|
911
949
|
* assert.notInclude([obj1, obj2], {a: 1});
|
|
912
950
|
* assert.notInclude({foo: obj1, bar: obj2}, {foo: {a: 1}});
|
|
913
951
|
* assert.notInclude({foo: obj1, bar: obj2}, {foo: obj1, bar: {b: 2}});
|
|
914
952
|
*
|
|
915
953
|
* @name notInclude
|
|
916
|
-
* @param {Array|
|
|
917
|
-
* @param {unknown}
|
|
918
|
-
* @param {
|
|
954
|
+
* @param {Array | string} exp
|
|
955
|
+
* @param {unknown} inc
|
|
956
|
+
* @param {string} msg
|
|
919
957
|
* @namespace Assert
|
|
920
958
|
* @public
|
|
921
959
|
*/
|
|
@@ -931,15 +969,15 @@ assert.notInclude = function (exp, inc, msg) {
|
|
|
931
969
|
* Deep equality is used.
|
|
932
970
|
*
|
|
933
971
|
* var obj1 = {a: 1}
|
|
934
|
-
*
|
|
972
|
+
* , obj2 = {b: 2};
|
|
935
973
|
* assert.deepInclude([obj1, obj2], {a: 1});
|
|
936
974
|
* assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}});
|
|
937
975
|
* assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 2}});
|
|
938
976
|
*
|
|
939
977
|
* @name deepInclude
|
|
940
|
-
* @param {Array|
|
|
941
|
-
* @param {unknown}
|
|
942
|
-
* @param {
|
|
978
|
+
* @param {Array | string} exp
|
|
979
|
+
* @param {unknown} inc
|
|
980
|
+
* @param {string} msg
|
|
943
981
|
* @namespace Assert
|
|
944
982
|
* @public
|
|
945
983
|
*/
|
|
@@ -955,15 +993,15 @@ assert.deepInclude = function (exp, inc, msg) {
|
|
|
955
993
|
* Deep equality is used.
|
|
956
994
|
*
|
|
957
995
|
* var obj1 = {a: 1}
|
|
958
|
-
*
|
|
996
|
+
* , obj2 = {b: 2};
|
|
959
997
|
* assert.notDeepInclude([obj1, obj2], {a: 9});
|
|
960
998
|
* assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 9}});
|
|
961
999
|
* assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 9}});
|
|
962
1000
|
*
|
|
963
1001
|
* @name notDeepInclude
|
|
964
|
-
* @param {Array|
|
|
965
|
-
* @param {unknown}
|
|
966
|
-
* @param {
|
|
1002
|
+
* @param {Array | string} exp
|
|
1003
|
+
* @param {unknown} inc
|
|
1004
|
+
* @param {string} msg
|
|
967
1005
|
* @namespace Assert
|
|
968
1006
|
* @public
|
|
969
1007
|
*/
|
|
@@ -985,9 +1023,9 @@ assert.notDeepInclude = function (exp, inc, msg) {
|
|
|
985
1023
|
* assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
|
|
986
1024
|
*
|
|
987
1025
|
* @name nestedInclude
|
|
988
|
-
* @param {
|
|
989
|
-
* @param {
|
|
990
|
-
* @param {
|
|
1026
|
+
* @param {object} exp
|
|
1027
|
+
* @param {object} inc
|
|
1028
|
+
* @param {string} msg
|
|
991
1029
|
* @namespace Assert
|
|
992
1030
|
* @public
|
|
993
1031
|
*/
|
|
@@ -1009,9 +1047,9 @@ assert.nestedInclude = function (exp, inc, msg) {
|
|
|
1009
1047
|
* assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
|
|
1010
1048
|
*
|
|
1011
1049
|
* @name notNestedInclude
|
|
1012
|
-
* @param {
|
|
1013
|
-
* @param {
|
|
1014
|
-
* @param {
|
|
1050
|
+
* @param {object} exp
|
|
1051
|
+
* @param {object} inc
|
|
1052
|
+
* @param {string} msg
|
|
1015
1053
|
* @namespace Assert
|
|
1016
1054
|
* @public
|
|
1017
1055
|
*/
|
|
@@ -1034,9 +1072,9 @@ assert.notNestedInclude = function (exp, inc, msg) {
|
|
|
1034
1072
|
* assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
|
|
1035
1073
|
*
|
|
1036
1074
|
* @name deepNestedInclude
|
|
1037
|
-
* @param {
|
|
1038
|
-
* @param {
|
|
1039
|
-
* @param {
|
|
1075
|
+
* @param {object} exp
|
|
1076
|
+
* @param {object} inc
|
|
1077
|
+
* @param {string} msg
|
|
1040
1078
|
* @namespace Assert
|
|
1041
1079
|
* @public
|
|
1042
1080
|
*/
|
|
@@ -1059,9 +1097,9 @@ assert.deepNestedInclude = function(exp, inc, msg) {
|
|
|
1059
1097
|
* assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
|
|
1060
1098
|
*
|
|
1061
1099
|
* @name notDeepNestedInclude
|
|
1062
|
-
* @param {
|
|
1063
|
-
* @param {
|
|
1064
|
-
* @param {
|
|
1100
|
+
* @param {object} exp
|
|
1101
|
+
* @param {object} inc
|
|
1102
|
+
* @param {string} msg
|
|
1065
1103
|
* @namespace Assert
|
|
1066
1104
|
* @public
|
|
1067
1105
|
*/
|
|
@@ -1080,9 +1118,9 @@ assert.notDeepNestedInclude = function(exp, inc, msg) {
|
|
|
1080
1118
|
* assert.ownInclude({ a: 1 }, { a: 1 });
|
|
1081
1119
|
*
|
|
1082
1120
|
* @name ownInclude
|
|
1083
|
-
* @param {
|
|
1084
|
-
* @param {
|
|
1085
|
-
* @param {
|
|
1121
|
+
* @param {object} exp
|
|
1122
|
+
* @param {object} inc
|
|
1123
|
+
* @param {string} msg
|
|
1086
1124
|
* @namespace Assert
|
|
1087
1125
|
* @public
|
|
1088
1126
|
*/
|
|
@@ -1098,13 +1136,12 @@ assert.ownInclude = function(exp, inc, msg) {
|
|
|
1098
1136
|
* object while ignoring inherited properties.
|
|
1099
1137
|
*
|
|
1100
1138
|
* Object.prototype.b = 2;
|
|
1101
|
-
*
|
|
1102
1139
|
* assert.notOwnInclude({ a: 1 }, { b: 2 });
|
|
1103
1140
|
*
|
|
1104
1141
|
* @name notOwnInclude
|
|
1105
|
-
* @param {
|
|
1106
|
-
* @param {
|
|
1107
|
-
* @param {
|
|
1142
|
+
* @param {object} exp
|
|
1143
|
+
* @param {object} inc
|
|
1144
|
+
* @param {string} msg
|
|
1108
1145
|
* @namespace Assert
|
|
1109
1146
|
* @public
|
|
1110
1147
|
*/
|
|
@@ -1119,12 +1156,12 @@ assert.notOwnInclude = function(exp, inc, msg) {
|
|
|
1119
1156
|
* Can be used to assert the inclusion of a subset of properties in an
|
|
1120
1157
|
* object while ignoring inherited properties and checking for deep equality.
|
|
1121
1158
|
*
|
|
1122
|
-
*
|
|
1159
|
+
* assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}});
|
|
1123
1160
|
*
|
|
1124
1161
|
* @name deepOwnInclude
|
|
1125
|
-
* @param {
|
|
1126
|
-
* @param {
|
|
1127
|
-
* @param {
|
|
1162
|
+
* @param {object} exp
|
|
1163
|
+
* @param {object} inc
|
|
1164
|
+
* @param {string} msg
|
|
1128
1165
|
* @namespace Assert
|
|
1129
1166
|
* @public
|
|
1130
1167
|
*/
|
|
@@ -1133,19 +1170,19 @@ assert.deepOwnInclude = function(exp, inc, msg) {
|
|
|
1133
1170
|
.deep.own.include(inc);
|
|
1134
1171
|
};
|
|
1135
1172
|
|
|
1136
|
-
|
|
1173
|
+
/**
|
|
1137
1174
|
* ### .notDeepOwnInclude(haystack, needle, [message])
|
|
1138
1175
|
*
|
|
1139
|
-
* Asserts that 'haystack'
|
|
1176
|
+
* Asserts that 'haystack' includes 'needle'.
|
|
1140
1177
|
* Can be used to assert the absence of a subset of properties in an
|
|
1141
1178
|
* object while ignoring inherited properties and checking for deep equality.
|
|
1142
1179
|
*
|
|
1143
|
-
*
|
|
1180
|
+
* assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}});
|
|
1144
1181
|
*
|
|
1145
1182
|
* @name notDeepOwnInclude
|
|
1146
|
-
* @param {
|
|
1147
|
-
* @param {
|
|
1148
|
-
* @param {
|
|
1183
|
+
* @param {object} exp
|
|
1184
|
+
* @param {object} inc
|
|
1185
|
+
* @param {string} msg
|
|
1149
1186
|
* @namespace Assert
|
|
1150
1187
|
* @public
|
|
1151
1188
|
*/
|
|
@@ -1162,9 +1199,9 @@ assert.notDeepOwnInclude = function(exp, inc, msg) {
|
|
|
1162
1199
|
* assert.match('foobar', /^foo/, 'regexp matches');
|
|
1163
1200
|
*
|
|
1164
1201
|
* @name match
|
|
1165
|
-
* @param {unknown}
|
|
1166
|
-
* @param {RegExp}
|
|
1167
|
-
* @param {
|
|
1202
|
+
* @param {unknown} exp
|
|
1203
|
+
* @param {RegExp} re
|
|
1204
|
+
* @param {string} msg
|
|
1168
1205
|
* @namespace Assert
|
|
1169
1206
|
* @public
|
|
1170
1207
|
*/
|
|
@@ -1180,9 +1217,9 @@ assert.match = function (exp, re, msg) {
|
|
|
1180
1217
|
* assert.notMatch('foobar', /^foo/, 'regexp does not match');
|
|
1181
1218
|
*
|
|
1182
1219
|
* @name notMatch
|
|
1183
|
-
* @param {unknown}
|
|
1184
|
-
* @param {RegExp}
|
|
1185
|
-
* @param {
|
|
1220
|
+
* @param {unknown} exp
|
|
1221
|
+
* @param {RegExp} re
|
|
1222
|
+
* @param {string} msg
|
|
1186
1223
|
* @namespace Assert
|
|
1187
1224
|
* @public
|
|
1188
1225
|
*/
|
|
@@ -1200,9 +1237,9 @@ assert.notMatch = function (exp, re, msg) {
|
|
|
1200
1237
|
* assert.property({ tea: { green: 'matcha' }}, 'toString');
|
|
1201
1238
|
*
|
|
1202
1239
|
* @name property
|
|
1203
|
-
* @param {
|
|
1204
|
-
* @param {
|
|
1205
|
-
* @param {
|
|
1240
|
+
* @param {object} obj
|
|
1241
|
+
* @param {string} prop
|
|
1242
|
+
* @param {string} msg
|
|
1206
1243
|
* @namespace Assert
|
|
1207
1244
|
* @public
|
|
1208
1245
|
*/
|
|
@@ -1219,9 +1256,9 @@ assert.property = function (obj, prop, msg) {
|
|
|
1219
1256
|
* assert.notProperty({ tea: { green: 'matcha' }}, 'coffee');
|
|
1220
1257
|
*
|
|
1221
1258
|
* @name notProperty
|
|
1222
|
-
* @param {
|
|
1223
|
-
* @param {
|
|
1224
|
-
* @param {
|
|
1259
|
+
* @param {object} obj
|
|
1260
|
+
* @param {string} prop
|
|
1261
|
+
* @param {string} msg
|
|
1225
1262
|
* @namespace Assert
|
|
1226
1263
|
* @public
|
|
1227
1264
|
*/
|
|
@@ -1240,10 +1277,10 @@ assert.notProperty = function (obj, prop, msg) {
|
|
|
1240
1277
|
* assert.propertyVal({ tea: 'is good' }, 'tea', 'is good');
|
|
1241
1278
|
*
|
|
1242
1279
|
* @name propertyVal
|
|
1243
|
-
* @param {
|
|
1244
|
-
* @param {
|
|
1245
|
-
* @param {unknown}
|
|
1246
|
-
* @param {
|
|
1280
|
+
* @param {object} obj
|
|
1281
|
+
* @param {string} prop
|
|
1282
|
+
* @param {unknown} val
|
|
1283
|
+
* @param {string} msg
|
|
1247
1284
|
* @namespace Assert
|
|
1248
1285
|
* @public
|
|
1249
1286
|
*/
|
|
@@ -1263,10 +1300,10 @@ assert.propertyVal = function (obj, prop, val, msg) {
|
|
|
1263
1300
|
* assert.notPropertyVal({ tea: 'is good' }, 'coffee', 'is good');
|
|
1264
1301
|
*
|
|
1265
1302
|
* @name notPropertyVal
|
|
1266
|
-
* @param {
|
|
1267
|
-
* @param {
|
|
1268
|
-
* @param {unknown}
|
|
1269
|
-
* @param {
|
|
1303
|
+
* @param {object} obj
|
|
1304
|
+
* @param {string} prop
|
|
1305
|
+
* @param {unknown} val
|
|
1306
|
+
* @param {string} msg
|
|
1270
1307
|
* @namespace Assert
|
|
1271
1308
|
* @public
|
|
1272
1309
|
*/
|
|
@@ -1284,10 +1321,10 @@ assert.notPropertyVal = function (obj, prop, val, msg) {
|
|
|
1284
1321
|
* assert.deepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' });
|
|
1285
1322
|
*
|
|
1286
1323
|
* @name deepPropertyVal
|
|
1287
|
-
* @param {
|
|
1288
|
-
* @param {
|
|
1289
|
-
* @param {unknown}
|
|
1290
|
-
* @param {
|
|
1324
|
+
* @param {object} obj
|
|
1325
|
+
* @param {string} prop
|
|
1326
|
+
* @param {unknown} val
|
|
1327
|
+
* @param {string} msg
|
|
1291
1328
|
* @namespace Assert
|
|
1292
1329
|
* @public
|
|
1293
1330
|
*/
|
|
@@ -1307,10 +1344,10 @@ assert.deepPropertyVal = function (obj, prop, val, msg) {
|
|
|
1307
1344
|
* assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' });
|
|
1308
1345
|
*
|
|
1309
1346
|
* @name notDeepPropertyVal
|
|
1310
|
-
* @param {
|
|
1311
|
-
* @param {
|
|
1312
|
-
* @param {unknown}
|
|
1313
|
-
* @param {
|
|
1347
|
+
* @param {object} obj
|
|
1348
|
+
* @param {string} prop
|
|
1349
|
+
* @param {unknown} val
|
|
1350
|
+
* @param {string} msg
|
|
1314
1351
|
* @namespace Assert
|
|
1315
1352
|
* @public
|
|
1316
1353
|
*/
|
|
@@ -1328,9 +1365,9 @@ assert.notDeepPropertyVal = function (obj, prop, val, msg) {
|
|
|
1328
1365
|
* assert.ownProperty({ tea: { green: 'matcha' }}, 'tea');
|
|
1329
1366
|
*
|
|
1330
1367
|
* @name ownProperty
|
|
1331
|
-
* @param {
|
|
1332
|
-
* @param {
|
|
1333
|
-
* @param {
|
|
1368
|
+
* @param {object} obj
|
|
1369
|
+
* @param {string} prop
|
|
1370
|
+
* @param {string} msg
|
|
1334
1371
|
* @public
|
|
1335
1372
|
*/
|
|
1336
1373
|
assert.ownProperty = function (obj, prop, msg) {
|
|
@@ -1348,9 +1385,9 @@ assert.ownProperty = function (obj, prop, msg) {
|
|
|
1348
1385
|
* assert.notOwnProperty({}, 'toString');
|
|
1349
1386
|
*
|
|
1350
1387
|
* @name notOwnProperty
|
|
1351
|
-
* @param {
|
|
1352
|
-
* @param {
|
|
1353
|
-
* @param {
|
|
1388
|
+
* @param {object} obj
|
|
1389
|
+
* @param {string} prop
|
|
1390
|
+
* @param {string} msg
|
|
1354
1391
|
* @public
|
|
1355
1392
|
*/
|
|
1356
1393
|
assert.notOwnProperty = function (obj, prop, msg) {
|
|
@@ -1368,10 +1405,10 @@ assert.notOwnProperty = function (obj, prop, msg) {
|
|
|
1368
1405
|
* assert.ownPropertyVal({ coffee: 'is good'}, 'coffee', 'is good');
|
|
1369
1406
|
*
|
|
1370
1407
|
* @name ownPropertyVal
|
|
1371
|
-
* @param {
|
|
1372
|
-
* @param {
|
|
1408
|
+
* @param {object} obj
|
|
1409
|
+
* @param {string} prop
|
|
1373
1410
|
* @param {unknown} value
|
|
1374
|
-
* @param {
|
|
1411
|
+
* @param {string} msg
|
|
1375
1412
|
* @public
|
|
1376
1413
|
*/
|
|
1377
1414
|
assert.ownPropertyVal = function (obj, prop, value, msg) {
|
|
@@ -1390,10 +1427,10 @@ assert.ownPropertyVal = function (obj, prop, value, msg) {
|
|
|
1390
1427
|
* assert.notOwnPropertyVal({}, 'toString', Object.prototype.toString);
|
|
1391
1428
|
*
|
|
1392
1429
|
* @name notOwnPropertyVal
|
|
1393
|
-
* @param {
|
|
1394
|
-
* @param {
|
|
1430
|
+
* @param {object} obj
|
|
1431
|
+
* @param {string} prop
|
|
1395
1432
|
* @param {unknown} value
|
|
1396
|
-
* @param {
|
|
1433
|
+
* @param {string} msg
|
|
1397
1434
|
* @public
|
|
1398
1435
|
*/
|
|
1399
1436
|
assert.notOwnPropertyVal = function (obj, prop, value, msg) {
|
|
@@ -1411,10 +1448,10 @@ assert.notOwnPropertyVal = function (obj, prop, value, msg) {
|
|
|
1411
1448
|
* assert.deepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' });
|
|
1412
1449
|
*
|
|
1413
1450
|
* @name deepOwnPropertyVal
|
|
1414
|
-
* @param {
|
|
1415
|
-
* @param {
|
|
1451
|
+
* @param {object} obj
|
|
1452
|
+
* @param {string} prop
|
|
1416
1453
|
* @param {unknown} value
|
|
1417
|
-
* @param {
|
|
1454
|
+
* @param {string} msg
|
|
1418
1455
|
* @public
|
|
1419
1456
|
*/
|
|
1420
1457
|
assert.deepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
@@ -1435,10 +1472,10 @@ assert.deepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
|
1435
1472
|
* assert.notDeepOwnPropertyVal({}, 'toString', Object.prototype.toString);
|
|
1436
1473
|
*
|
|
1437
1474
|
* @name notDeepOwnPropertyVal
|
|
1438
|
-
* @param {
|
|
1439
|
-
* @param {
|
|
1475
|
+
* @param {object} obj
|
|
1476
|
+
* @param {string} prop
|
|
1440
1477
|
* @param {unknown} value
|
|
1441
|
-
* @param {
|
|
1478
|
+
* @param {string} msg
|
|
1442
1479
|
* @public
|
|
1443
1480
|
*/
|
|
1444
1481
|
assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
@@ -1456,9 +1493,9 @@ assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) {
|
|
|
1456
1493
|
* assert.nestedProperty({ tea: { green: 'matcha' }}, 'tea.green');
|
|
1457
1494
|
*
|
|
1458
1495
|
* @name nestedProperty
|
|
1459
|
-
* @param {
|
|
1460
|
-
* @param {
|
|
1461
|
-
* @param {
|
|
1496
|
+
* @param {object} obj
|
|
1497
|
+
* @param {string} prop
|
|
1498
|
+
* @param {string} msg
|
|
1462
1499
|
* @namespace Assert
|
|
1463
1500
|
* @public
|
|
1464
1501
|
*/
|
|
@@ -1477,9 +1514,9 @@ assert.nestedProperty = function (obj, prop, msg) {
|
|
|
1477
1514
|
* assert.notNestedProperty({ tea: { green: 'matcha' }}, 'tea.oolong');
|
|
1478
1515
|
*
|
|
1479
1516
|
* @name notNestedProperty
|
|
1480
|
-
* @param {
|
|
1481
|
-
* @param {
|
|
1482
|
-
* @param {
|
|
1517
|
+
* @param {object} obj
|
|
1518
|
+
* @param {string} prop
|
|
1519
|
+
* @param {string} msg
|
|
1483
1520
|
* @namespace Assert
|
|
1484
1521
|
* @public
|
|
1485
1522
|
*/
|
|
@@ -1498,10 +1535,10 @@ assert.notNestedProperty = function (obj, prop, msg) {
|
|
|
1498
1535
|
* assert.nestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha');
|
|
1499
1536
|
*
|
|
1500
1537
|
* @name nestedPropertyVal
|
|
1501
|
-
* @param {
|
|
1502
|
-
* @param {
|
|
1503
|
-
* @param {unknown}
|
|
1504
|
-
* @param {
|
|
1538
|
+
* @param {object} obj
|
|
1539
|
+
* @param {string} prop
|
|
1540
|
+
* @param {unknown} val
|
|
1541
|
+
* @param {string} msg
|
|
1505
1542
|
* @namespace Assert
|
|
1506
1543
|
* @public
|
|
1507
1544
|
*/
|
|
@@ -1521,10 +1558,10 @@ assert.nestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1521
1558
|
* assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'coffee.green', 'matcha');
|
|
1522
1559
|
*
|
|
1523
1560
|
* @name notNestedPropertyVal
|
|
1524
|
-
* @param {
|
|
1525
|
-
* @param {
|
|
1526
|
-
* @param {unknown}
|
|
1527
|
-
* @param {
|
|
1561
|
+
* @param {object} obj
|
|
1562
|
+
* @param {string} prop
|
|
1563
|
+
* @param {unknown} val
|
|
1564
|
+
* @param {string} msg
|
|
1528
1565
|
* @namespace Assert
|
|
1529
1566
|
* @public
|
|
1530
1567
|
*/
|
|
@@ -1543,10 +1580,10 @@ assert.notNestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1543
1580
|
* assert.deepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yum' });
|
|
1544
1581
|
*
|
|
1545
1582
|
* @name deepNestedPropertyVal
|
|
1546
|
-
* @param {
|
|
1547
|
-
* @param {
|
|
1548
|
-
* @param {unknown}
|
|
1549
|
-
* @param {
|
|
1583
|
+
* @param {object} obj
|
|
1584
|
+
* @param {string} prop
|
|
1585
|
+
* @param {unknown} val
|
|
1586
|
+
* @param {string} msg
|
|
1550
1587
|
* @namespace Assert
|
|
1551
1588
|
* @public
|
|
1552
1589
|
*/
|
|
@@ -1567,10 +1604,10 @@ assert.deepNestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1567
1604
|
* assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.black', { matcha: 'yum' });
|
|
1568
1605
|
*
|
|
1569
1606
|
* @name notDeepNestedPropertyVal
|
|
1570
|
-
* @param {
|
|
1571
|
-
* @param {
|
|
1572
|
-
* @param {unknown}
|
|
1573
|
-
* @param {
|
|
1607
|
+
* @param {object} obj
|
|
1608
|
+
* @param {string} prop
|
|
1609
|
+
* @param {unknown} val
|
|
1610
|
+
* @param {string} msg
|
|
1574
1611
|
* @namespace Assert
|
|
1575
1612
|
* @public
|
|
1576
1613
|
*/
|
|
@@ -1590,9 +1627,9 @@ assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) {
|
|
|
1590
1627
|
* assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3');
|
|
1591
1628
|
*
|
|
1592
1629
|
* @name lengthOf
|
|
1593
|
-
* @param {unknown}
|
|
1594
|
-
* @param {
|
|
1595
|
-
* @param {
|
|
1630
|
+
* @param {unknown} exp
|
|
1631
|
+
* @param {number} len
|
|
1632
|
+
* @param {string} msg
|
|
1596
1633
|
* @namespace Assert
|
|
1597
1634
|
* @public
|
|
1598
1635
|
*/
|
|
@@ -1613,9 +1650,9 @@ assert.lengthOf = function (exp, len, msg) {
|
|
|
1613
1650
|
* assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
|
1614
1651
|
*
|
|
1615
1652
|
* @name hasAnyKeys
|
|
1616
|
-
* @param {unknown}
|
|
1617
|
-
* @param {Array|
|
|
1618
|
-
* @param {
|
|
1653
|
+
* @param {unknown} obj
|
|
1654
|
+
* @param {Array | object} keys
|
|
1655
|
+
* @param {string} msg
|
|
1619
1656
|
* @namespace Assert
|
|
1620
1657
|
* @public
|
|
1621
1658
|
*/
|
|
@@ -1636,9 +1673,9 @@ assert.hasAnyKeys = function (obj, keys, msg) {
|
|
|
1636
1673
|
* assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
|
1637
1674
|
*
|
|
1638
1675
|
* @name hasAllKeys
|
|
1639
|
-
* @param {unknown}
|
|
1640
|
-
* @param {
|
|
1641
|
-
* @param {
|
|
1676
|
+
* @param {unknown} obj
|
|
1677
|
+
* @param {string[]} keys
|
|
1678
|
+
* @param {string} msg
|
|
1642
1679
|
* @namespace Assert
|
|
1643
1680
|
* @public
|
|
1644
1681
|
*/
|
|
@@ -1663,9 +1700,9 @@ assert.hasAllKeys = function (obj, keys, msg) {
|
|
|
1663
1700
|
* assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
|
1664
1701
|
*
|
|
1665
1702
|
* @name containsAllKeys
|
|
1666
|
-
* @param {unknown}
|
|
1667
|
-
* @param {
|
|
1668
|
-
* @param {
|
|
1703
|
+
* @param {unknown} obj
|
|
1704
|
+
* @param {string[]} keys
|
|
1705
|
+
* @param {string} msg
|
|
1669
1706
|
* @namespace Assert
|
|
1670
1707
|
* @public
|
|
1671
1708
|
*/
|
|
@@ -1687,9 +1724,9 @@ assert.containsAllKeys = function (obj, keys, msg) {
|
|
|
1687
1724
|
* assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']);
|
|
1688
1725
|
*
|
|
1689
1726
|
* @name doesNotHaveAnyKeys
|
|
1690
|
-
* @param {unknown}
|
|
1691
|
-
* @param {
|
|
1692
|
-
* @param {
|
|
1727
|
+
* @param {unknown} obj
|
|
1728
|
+
* @param {string[]} keys
|
|
1729
|
+
* @param {string} msg
|
|
1693
1730
|
* @namespace Assert
|
|
1694
1731
|
* @public
|
|
1695
1732
|
*/
|
|
@@ -1711,9 +1748,9 @@ assert.doesNotHaveAnyKeys = function (obj, keys, msg) {
|
|
|
1711
1748
|
* assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']);
|
|
1712
1749
|
*
|
|
1713
1750
|
* @name doesNotHaveAllKeys
|
|
1714
|
-
* @param {unknown}
|
|
1715
|
-
* @param {
|
|
1716
|
-
* @param {
|
|
1751
|
+
* @param {unknown} obj
|
|
1752
|
+
* @param {string[]} keys
|
|
1753
|
+
* @param {string} msg
|
|
1717
1754
|
* @namespace Assert
|
|
1718
1755
|
* @public
|
|
1719
1756
|
*/
|
|
@@ -1739,9 +1776,9 @@ assert.doesNotHaveAllKeys = function (obj, keys, msg) {
|
|
|
1739
1776
|
* assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
|
1740
1777
|
*
|
|
1741
1778
|
* @name hasAnyDeepKeys
|
|
1742
|
-
* @param {unknown}
|
|
1743
|
-
* @param {Array|
|
|
1744
|
-
* @param {
|
|
1779
|
+
* @param {unknown} obj
|
|
1780
|
+
* @param {Array | object} keys
|
|
1781
|
+
* @param {string} msg
|
|
1745
1782
|
* @namespace Assert
|
|
1746
1783
|
* @public
|
|
1747
1784
|
*/
|
|
@@ -1765,9 +1802,9 @@ assert.hasAnyDeepKeys = function (obj, keys, msg) {
|
|
|
1765
1802
|
* assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
|
1766
1803
|
*
|
|
1767
1804
|
* @name hasAllDeepKeys
|
|
1768
|
-
* @param {unknown}
|
|
1769
|
-
* @param {Array|
|
|
1770
|
-
* @param {
|
|
1805
|
+
* @param {unknown} obj
|
|
1806
|
+
* @param {Array | object} keys
|
|
1807
|
+
* @param {string} msg
|
|
1771
1808
|
* @namespace Assert
|
|
1772
1809
|
* @public
|
|
1773
1810
|
*/
|
|
@@ -1791,9 +1828,9 @@ assert.hasAllDeepKeys = function (obj, keys, msg) {
|
|
|
1791
1828
|
* assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
|
1792
1829
|
*
|
|
1793
1830
|
* @name containsAllDeepKeys
|
|
1794
|
-
* @param {unknown}
|
|
1795
|
-
* @param {Array|
|
|
1796
|
-
* @param {
|
|
1831
|
+
* @param {unknown} obj
|
|
1832
|
+
* @param {Array | object} keys
|
|
1833
|
+
* @param {string} msg
|
|
1797
1834
|
* @namespace Assert
|
|
1798
1835
|
* @public
|
|
1799
1836
|
*/
|
|
@@ -1817,9 +1854,9 @@ assert.containsAllDeepKeys = function (obj, keys, msg) {
|
|
|
1817
1854
|
* assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]);
|
|
1818
1855
|
*
|
|
1819
1856
|
* @name doesNotHaveAnyDeepKeys
|
|
1820
|
-
* @param {unknown}
|
|
1821
|
-
* @param {Array|
|
|
1822
|
-
* @param {
|
|
1857
|
+
* @param {unknown} obj
|
|
1858
|
+
* @param {Array | object} keys
|
|
1859
|
+
* @param {string} msg
|
|
1823
1860
|
* @namespace Assert
|
|
1824
1861
|
* @public
|
|
1825
1862
|
*/
|
|
@@ -1843,9 +1880,9 @@ assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) {
|
|
|
1843
1880
|
* assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]);
|
|
1844
1881
|
*
|
|
1845
1882
|
* @name doesNotHaveAllDeepKeys
|
|
1846
|
-
* @param {unknown}
|
|
1847
|
-
* @param {Array|
|
|
1848
|
-
* @param {
|
|
1883
|
+
* @param {unknown} obj
|
|
1884
|
+
* @param {Array | object} keys
|
|
1885
|
+
* @param {string} msg
|
|
1849
1886
|
* @namespace Assert
|
|
1850
1887
|
* @public
|
|
1851
1888
|
*/
|
|
@@ -1877,9 +1914,10 @@ assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) {
|
|
|
1877
1914
|
* @alias throw
|
|
1878
1915
|
* @alias Throw
|
|
1879
1916
|
* @param {Function} fn
|
|
1880
|
-
* @param {
|
|
1881
|
-
* @param {RegExp|
|
|
1882
|
-
* @param {
|
|
1917
|
+
* @param {Error} errorLike
|
|
1918
|
+
* @param {RegExp | string} errMsgMatcher
|
|
1919
|
+
* @param {string} msg
|
|
1920
|
+
* @returns {unknown}
|
|
1883
1921
|
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
|
|
1884
1922
|
* @namespace Assert
|
|
1885
1923
|
* @public
|
|
@@ -1916,20 +1954,20 @@ assert.throws = function (fn, errorLike, errMsgMatcher, msg) {
|
|
|
1916
1954
|
*
|
|
1917
1955
|
* @name doesNotThrow
|
|
1918
1956
|
* @param {Function} fn
|
|
1919
|
-
* @param {
|
|
1920
|
-
* @param {RegExp|
|
|
1921
|
-
* @param {
|
|
1957
|
+
* @param {Error} errorLike
|
|
1958
|
+
* @param {RegExp | string} errMsgMatcher
|
|
1959
|
+
* @param {string} message
|
|
1922
1960
|
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
|
|
1923
1961
|
* @namespace Assert
|
|
1924
1962
|
* @public
|
|
1925
1963
|
*/
|
|
1926
|
-
assert.doesNotThrow = function (fn, errorLike, errMsgMatcher,
|
|
1964
|
+
assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, message) {
|
|
1927
1965
|
if ('string' === typeof errorLike || errorLike instanceof RegExp) {
|
|
1928
1966
|
errMsgMatcher = errorLike;
|
|
1929
1967
|
errorLike = null;
|
|
1930
1968
|
}
|
|
1931
1969
|
|
|
1932
|
-
new Assertion(fn,
|
|
1970
|
+
new Assertion(fn, message, assert.doesNotThrow, true)
|
|
1933
1971
|
.to.not.throw(errorLike, errMsgMatcher);
|
|
1934
1972
|
};
|
|
1935
1973
|
|
|
@@ -1942,10 +1980,10 @@ assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) {
|
|
|
1942
1980
|
* assert.operator(1, '>', 2, 'this will fail');
|
|
1943
1981
|
*
|
|
1944
1982
|
* @name operator
|
|
1945
|
-
* @param {unknown}
|
|
1946
|
-
* @param {
|
|
1983
|
+
* @param {unknown} val
|
|
1984
|
+
* @param {string} operator
|
|
1947
1985
|
* @param {unknown} val2
|
|
1948
|
-
* @param {
|
|
1986
|
+
* @param {string} msg
|
|
1949
1987
|
* @namespace Assert
|
|
1950
1988
|
* @public
|
|
1951
1989
|
*/
|
|
@@ -1999,10 +2037,10 @@ assert.operator = function (val, operator, val2, msg) {
|
|
|
1999
2037
|
* assert.closeTo(1.5, 1, 0.5, 'numbers are close');
|
|
2000
2038
|
*
|
|
2001
2039
|
* @name closeTo
|
|
2002
|
-
* @param {
|
|
2003
|
-
* @param {
|
|
2004
|
-
* @param {
|
|
2005
|
-
* @param {
|
|
2040
|
+
* @param {number} act
|
|
2041
|
+
* @param {number} exp
|
|
2042
|
+
* @param {number} delta
|
|
2043
|
+
* @param {string} msg
|
|
2006
2044
|
* @namespace Assert
|
|
2007
2045
|
* @public
|
|
2008
2046
|
*/
|
|
@@ -2018,10 +2056,10 @@ assert.closeTo = function (act, exp, delta, msg) {
|
|
|
2018
2056
|
* assert.approximately(1.5, 1, 0.5, 'numbers are close');
|
|
2019
2057
|
*
|
|
2020
2058
|
* @name approximately
|
|
2021
|
-
* @param {
|
|
2022
|
-
* @param {
|
|
2023
|
-
* @param {
|
|
2024
|
-
* @param {
|
|
2059
|
+
* @param {number} act
|
|
2060
|
+
* @param {number} exp
|
|
2061
|
+
* @param {number} delta
|
|
2062
|
+
* @param {string} msg
|
|
2025
2063
|
* @namespace Assert
|
|
2026
2064
|
* @public
|
|
2027
2065
|
*/
|
|
@@ -2041,7 +2079,7 @@ assert.approximately = function (act, exp, delta, msg) {
|
|
|
2041
2079
|
* @name sameMembers
|
|
2042
2080
|
* @param {Array} set1
|
|
2043
2081
|
* @param {Array} set2
|
|
2044
|
-
* @param {
|
|
2082
|
+
* @param {string} msg
|
|
2045
2083
|
* @namespace Assert
|
|
2046
2084
|
* @public
|
|
2047
2085
|
*/
|
|
@@ -2061,7 +2099,7 @@ assert.sameMembers = function (set1, set2, msg) {
|
|
|
2061
2099
|
* @name notSameMembers
|
|
2062
2100
|
* @param {Array} set1
|
|
2063
2101
|
* @param {Array} set2
|
|
2064
|
-
* @param {
|
|
2102
|
+
* @param {string} msg
|
|
2065
2103
|
* @namespace Assert
|
|
2066
2104
|
* @public
|
|
2067
2105
|
*/
|
|
@@ -2081,7 +2119,7 @@ assert.notSameMembers = function (set1, set2, msg) {
|
|
|
2081
2119
|
* @name sameDeepMembers
|
|
2082
2120
|
* @param {Array} set1
|
|
2083
2121
|
* @param {Array} set2
|
|
2084
|
-
* @param {
|
|
2122
|
+
* @param {string} msg
|
|
2085
2123
|
* @namespace Assert
|
|
2086
2124
|
* @public
|
|
2087
2125
|
*/
|
|
@@ -2101,7 +2139,7 @@ assert.sameDeepMembers = function (set1, set2, msg) {
|
|
|
2101
2139
|
* @name notSameDeepMembers
|
|
2102
2140
|
* @param {Array} set1
|
|
2103
2141
|
* @param {Array} set2
|
|
2104
|
-
* @param {
|
|
2142
|
+
* @param {string} msg
|
|
2105
2143
|
* @namespace Assert
|
|
2106
2144
|
* @public
|
|
2107
2145
|
*/
|
|
@@ -2121,7 +2159,7 @@ assert.notSameDeepMembers = function (set1, set2, msg) {
|
|
|
2121
2159
|
* @name sameOrderedMembers
|
|
2122
2160
|
* @param {Array} set1
|
|
2123
2161
|
* @param {Array} set2
|
|
2124
|
-
* @param {
|
|
2162
|
+
* @param {string} msg
|
|
2125
2163
|
* @namespace Assert
|
|
2126
2164
|
* @public
|
|
2127
2165
|
*/
|
|
@@ -2141,7 +2179,7 @@ assert.sameOrderedMembers = function (set1, set2, msg) {
|
|
|
2141
2179
|
* @name notSameOrderedMembers
|
|
2142
2180
|
* @param {Array} set1
|
|
2143
2181
|
* @param {Array} set2
|
|
2144
|
-
* @param {
|
|
2182
|
+
* @param {string} msg
|
|
2145
2183
|
* @namespace Assert
|
|
2146
2184
|
* @public
|
|
2147
2185
|
*/
|
|
@@ -2161,7 +2199,7 @@ assert.notSameOrderedMembers = function (set1, set2, msg) {
|
|
|
2161
2199
|
* @name sameDeepOrderedMembers
|
|
2162
2200
|
* @param {Array} set1
|
|
2163
2201
|
* @param {Array} set2
|
|
2164
|
-
* @param {
|
|
2202
|
+
* @param {string} msg
|
|
2165
2203
|
* @namespace Assert
|
|
2166
2204
|
* @public
|
|
2167
2205
|
*/
|
|
@@ -2182,7 +2220,7 @@ assert.sameDeepOrderedMembers = function (set1, set2, msg) {
|
|
|
2182
2220
|
* @name notSameDeepOrderedMembers
|
|
2183
2221
|
* @param {Array} set1
|
|
2184
2222
|
* @param {Array} set2
|
|
2185
|
-
* @param {
|
|
2223
|
+
* @param {string} msg
|
|
2186
2224
|
* @namespace Assert
|
|
2187
2225
|
* @public
|
|
2188
2226
|
*/
|
|
@@ -2202,7 +2240,7 @@ assert.notSameDeepOrderedMembers = function (set1, set2, msg) {
|
|
|
2202
2240
|
* @name includeMembers
|
|
2203
2241
|
* @param {Array} superset
|
|
2204
2242
|
* @param {Array} subset
|
|
2205
|
-
* @param {
|
|
2243
|
+
* @param {string} msg
|
|
2206
2244
|
* @namespace Assert
|
|
2207
2245
|
* @public
|
|
2208
2246
|
*/
|
|
@@ -2222,7 +2260,7 @@ assert.includeMembers = function (superset, subset, msg) {
|
|
|
2222
2260
|
* @name notIncludeMembers
|
|
2223
2261
|
* @param {Array} superset
|
|
2224
2262
|
* @param {Array} subset
|
|
2225
|
-
* @param {
|
|
2263
|
+
* @param {string} msg
|
|
2226
2264
|
* @namespace Assert
|
|
2227
2265
|
* @public
|
|
2228
2266
|
*/
|
|
@@ -2242,7 +2280,7 @@ assert.notIncludeMembers = function (superset, subset, msg) {
|
|
|
2242
2280
|
* @name includeDeepMembers
|
|
2243
2281
|
* @param {Array} superset
|
|
2244
2282
|
* @param {Array} subset
|
|
2245
|
-
* @param {
|
|
2283
|
+
* @param {string} msg
|
|
2246
2284
|
* @namespace Assert
|
|
2247
2285
|
* @public
|
|
2248
2286
|
*/
|
|
@@ -2262,7 +2300,7 @@ assert.includeDeepMembers = function (superset, subset, msg) {
|
|
|
2262
2300
|
* @name notIncludeDeepMembers
|
|
2263
2301
|
* @param {Array} superset
|
|
2264
2302
|
* @param {Array} subset
|
|
2265
|
-
* @param {
|
|
2303
|
+
* @param {string} msg
|
|
2266
2304
|
* @namespace Assert
|
|
2267
2305
|
* @public
|
|
2268
2306
|
*/
|
|
@@ -2283,7 +2321,7 @@ assert.notIncludeDeepMembers = function (superset, subset, msg) {
|
|
|
2283
2321
|
* @name includeOrderedMembers
|
|
2284
2322
|
* @param {Array} superset
|
|
2285
2323
|
* @param {Array} subset
|
|
2286
|
-
* @param {
|
|
2324
|
+
* @param {string} msg
|
|
2287
2325
|
* @namespace Assert
|
|
2288
2326
|
* @public
|
|
2289
2327
|
*/
|
|
@@ -2305,7 +2343,7 @@ assert.includeOrderedMembers = function (superset, subset, msg) {
|
|
|
2305
2343
|
* @name notIncludeOrderedMembers
|
|
2306
2344
|
* @param {Array} superset
|
|
2307
2345
|
* @param {Array} subset
|
|
2308
|
-
* @param {
|
|
2346
|
+
* @param {string} msg
|
|
2309
2347
|
* @namespace Assert
|
|
2310
2348
|
* @public
|
|
2311
2349
|
*/
|
|
@@ -2326,7 +2364,7 @@ assert.notIncludeOrderedMembers = function (superset, subset, msg) {
|
|
|
2326
2364
|
* @name includeDeepOrderedMembers
|
|
2327
2365
|
* @param {Array} superset
|
|
2328
2366
|
* @param {Array} subset
|
|
2329
|
-
* @param {
|
|
2367
|
+
* @param {string} msg
|
|
2330
2368
|
* @namespace Assert
|
|
2331
2369
|
* @public
|
|
2332
2370
|
*/
|
|
@@ -2349,7 +2387,7 @@ assert.includeDeepOrderedMembers = function (superset, subset, msg) {
|
|
|
2349
2387
|
* @name notIncludeDeepOrderedMembers
|
|
2350
2388
|
* @param {Array} superset
|
|
2351
2389
|
* @param {Array} subset
|
|
2352
|
-
* @param {
|
|
2390
|
+
* @param {string} msg
|
|
2353
2391
|
* @namespace Assert
|
|
2354
2392
|
* @public
|
|
2355
2393
|
*/
|
|
@@ -2368,7 +2406,7 @@ assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) {
|
|
|
2368
2406
|
* @name oneOf
|
|
2369
2407
|
* @param {*} inList
|
|
2370
2408
|
* @param {Array<*>} list
|
|
2371
|
-
* @param {
|
|
2409
|
+
* @param {string} msg
|
|
2372
2410
|
* @namespace Assert
|
|
2373
2411
|
* @public
|
|
2374
2412
|
*/
|
|
@@ -2387,7 +2425,7 @@ assert.oneOf = function (inList, list, msg) {
|
|
|
2387
2425
|
* @param {unknown} obj
|
|
2388
2426
|
* @param {string} [msg]
|
|
2389
2427
|
* @namespace Assert
|
|
2390
|
-
* @
|
|
2428
|
+
* @public
|
|
2391
2429
|
*/
|
|
2392
2430
|
assert.isIterable = function(obj, msg) {
|
|
2393
2431
|
if (obj == undefined || !obj[Symbol.iterator]) {
|
|
@@ -2413,10 +2451,10 @@ assert.isIterable = function(obj, msg) {
|
|
|
2413
2451
|
* assert.changes(fn, obj, 'val');
|
|
2414
2452
|
*
|
|
2415
2453
|
* @name changes
|
|
2416
|
-
* @param {Function} modifier function
|
|
2417
|
-
* @param {
|
|
2418
|
-
* @param {
|
|
2419
|
-
* @param {
|
|
2454
|
+
* @param {Function} fn modifier function
|
|
2455
|
+
* @param {object} obj object or getter function
|
|
2456
|
+
* @param {string} prop property name _optional_
|
|
2457
|
+
* @param {string} msg _optional_
|
|
2420
2458
|
* @namespace Assert
|
|
2421
2459
|
* @public
|
|
2422
2460
|
*/
|
|
@@ -2429,7 +2467,7 @@ assert.changes = function (fn, obj, prop, msg) {
|
|
|
2429
2467
|
new Assertion(fn, msg, assert.changes, true).to.change(obj, prop);
|
|
2430
2468
|
}
|
|
2431
2469
|
|
|
2432
|
-
|
|
2470
|
+
/**
|
|
2433
2471
|
* ### .changesBy(function, object, property, delta, [message])
|
|
2434
2472
|
*
|
|
2435
2473
|
* Asserts that a function changes the value of a property by an amount (delta).
|
|
@@ -2439,11 +2477,11 @@ assert.changes = function (fn, obj, prop, msg) {
|
|
|
2439
2477
|
* assert.changesBy(fn, obj, 'val', 2);
|
|
2440
2478
|
*
|
|
2441
2479
|
* @name changesBy
|
|
2442
|
-
* @param {Function} modifier function
|
|
2443
|
-
* @param {
|
|
2444
|
-
* @param {
|
|
2445
|
-
* @param {
|
|
2446
|
-
* @param {
|
|
2480
|
+
* @param {Function} fn modifier function
|
|
2481
|
+
* @param {object} obj object or getter function
|
|
2482
|
+
* @param {string} prop property name _optional_
|
|
2483
|
+
* @param {number} delta msg change amount (delta)
|
|
2484
|
+
* @param {string} msg _optional_
|
|
2447
2485
|
* @namespace Assert
|
|
2448
2486
|
* @public
|
|
2449
2487
|
*/
|
|
@@ -2461,20 +2499,21 @@ assert.changesBy = function (fn, obj, prop, delta, msg) {
|
|
|
2461
2499
|
.to.change(obj, prop).by(delta);
|
|
2462
2500
|
}
|
|
2463
2501
|
|
|
2464
|
-
|
|
2502
|
+
/**
|
|
2465
2503
|
* ### .doesNotChange(function, object, property, [message])
|
|
2466
2504
|
*
|
|
2467
2505
|
* Asserts that a function does not change the value of a property.
|
|
2468
2506
|
*
|
|
2469
|
-
*
|
|
2470
|
-
*
|
|
2471
|
-
*
|
|
2507
|
+
* var obj = { val: 10 };
|
|
2508
|
+
* var fn = function() { console.log('foo'); };
|
|
2509
|
+
* assert.doesNotChange(fn, obj, 'val');
|
|
2472
2510
|
*
|
|
2473
2511
|
* @name doesNotChange
|
|
2474
|
-
* @param {Function} modifier function
|
|
2475
|
-
* @param {
|
|
2476
|
-
* @param {
|
|
2477
|
-
* @param {
|
|
2512
|
+
* @param {Function} fn modifier function
|
|
2513
|
+
* @param {object} obj object or getter function
|
|
2514
|
+
* @param {string} prop property name _optional_
|
|
2515
|
+
* @param {string} msg _optional_
|
|
2516
|
+
* @returns {unknown}
|
|
2478
2517
|
* @namespace Assert
|
|
2479
2518
|
* @public
|
|
2480
2519
|
*/
|
|
@@ -2498,11 +2537,11 @@ assert.doesNotChange = function (fn, obj, prop, msg) {
|
|
|
2498
2537
|
* assert.changesButNotBy(fn, obj, 'val', 5);
|
|
2499
2538
|
*
|
|
2500
2539
|
* @name changesButNotBy
|
|
2501
|
-
* @param {Function} modifier function
|
|
2502
|
-
* @param {
|
|
2503
|
-
* @param {
|
|
2504
|
-
* @param {
|
|
2505
|
-
* @param {
|
|
2540
|
+
* @param {Function} fn - modifier function
|
|
2541
|
+
* @param {object} obj - object or getter function
|
|
2542
|
+
* @param {string} prop - property name _optional_
|
|
2543
|
+
* @param {number} delta - change amount (delta)
|
|
2544
|
+
* @param {string} msg - message _optional_
|
|
2506
2545
|
* @namespace Assert
|
|
2507
2546
|
* @public
|
|
2508
2547
|
*/
|
|
@@ -2529,13 +2568,14 @@ assert.changesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2529
2568
|
* var fn = function() { obj.val = 13 };
|
|
2530
2569
|
* assert.increases(fn, obj, 'val');
|
|
2531
2570
|
*
|
|
2532
|
-
* @name increases
|
|
2533
|
-
* @param {Function} modifier function
|
|
2534
|
-
* @param {Object} object or getter function
|
|
2535
|
-
* @param {String} property name _optional_
|
|
2536
|
-
* @param {String} message _optional_
|
|
2537
|
-
* @namespace Assert
|
|
2538
2571
|
* @public
|
|
2572
|
+
* @namespace Assert
|
|
2573
|
+
* @name increases
|
|
2574
|
+
* @param {Function} fn - modifier function
|
|
2575
|
+
* @param {object} obj - object or getter function
|
|
2576
|
+
* @param {string} prop - property name _optional_
|
|
2577
|
+
* @param {string} msg - message _optional_
|
|
2578
|
+
* @returns {unknown}
|
|
2539
2579
|
*/
|
|
2540
2580
|
assert.increases = function (fn, obj, prop, msg) {
|
|
2541
2581
|
if (arguments.length === 3 && typeof obj === 'function') {
|
|
@@ -2556,14 +2596,14 @@ assert.increases = function (fn, obj, prop, msg) {
|
|
|
2556
2596
|
* var fn = function() { obj.val += 10 };
|
|
2557
2597
|
* assert.increasesBy(fn, obj, 'val', 10);
|
|
2558
2598
|
*
|
|
2599
|
+
* @public
|
|
2559
2600
|
* @name increasesBy
|
|
2560
|
-
* @param {Function} modifier function
|
|
2561
|
-
* @param {Object} object or getter function
|
|
2562
|
-
* @param {String} property name _optional_
|
|
2563
|
-
* @param {Number} change amount (delta)
|
|
2564
|
-
* @param {String} message _optional_
|
|
2565
2601
|
* @namespace Assert
|
|
2566
|
-
* @
|
|
2602
|
+
* @param {Function} fn - modifier function
|
|
2603
|
+
* @param {object} obj - object or getter function
|
|
2604
|
+
* @param {string} prop - property name _optional_
|
|
2605
|
+
* @param {number} delta - change amount (delta)
|
|
2606
|
+
* @param {string} msg - message _optional_
|
|
2567
2607
|
*/
|
|
2568
2608
|
assert.increasesBy = function (fn, obj, prop, delta, msg) {
|
|
2569
2609
|
if (arguments.length === 4 && typeof obj === 'function') {
|
|
@@ -2589,10 +2629,11 @@ assert.increasesBy = function (fn, obj, prop, delta, msg) {
|
|
|
2589
2629
|
* assert.doesNotIncrease(fn, obj, 'val');
|
|
2590
2630
|
*
|
|
2591
2631
|
* @name doesNotIncrease
|
|
2592
|
-
* @param {Function} modifier function
|
|
2593
|
-
* @param {
|
|
2594
|
-
* @param {
|
|
2595
|
-
* @
|
|
2632
|
+
* @param {Function} fn modifier function
|
|
2633
|
+
* @param {object} obj object or getter function
|
|
2634
|
+
* @param {string} prop property name _optional_
|
|
2635
|
+
* @returns {Assertion}
|
|
2636
|
+
* @param {string} msg _optional_
|
|
2596
2637
|
* @namespace Assert
|
|
2597
2638
|
* @public
|
|
2598
2639
|
*/
|
|
@@ -2616,11 +2657,11 @@ assert.doesNotIncrease = function (fn, obj, prop, msg) {
|
|
|
2616
2657
|
* assert.increasesButNotBy(fn, obj, 'val', 10);
|
|
2617
2658
|
*
|
|
2618
2659
|
* @name increasesButNotBy
|
|
2619
|
-
* @param {Function} modifier function
|
|
2620
|
-
* @param {
|
|
2621
|
-
* @param {
|
|
2622
|
-
* @param {
|
|
2623
|
-
* @param {
|
|
2660
|
+
* @param {Function} fn modifier function
|
|
2661
|
+
* @param {object} obj object or getter function
|
|
2662
|
+
* @param {string} prop property name _optional_
|
|
2663
|
+
* @param {number} delta change amount (delta)
|
|
2664
|
+
* @param {string} msg _optional_
|
|
2624
2665
|
* @namespace Assert
|
|
2625
2666
|
* @public
|
|
2626
2667
|
*/
|
|
@@ -2648,10 +2689,11 @@ assert.increasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2648
2689
|
* assert.decreases(fn, obj, 'val');
|
|
2649
2690
|
*
|
|
2650
2691
|
* @name decreases
|
|
2651
|
-
* @param {Function} modifier function
|
|
2652
|
-
* @param {
|
|
2653
|
-
* @param {
|
|
2654
|
-
* @
|
|
2692
|
+
* @param {Function} fn modifier function
|
|
2693
|
+
* @param {object} obj object or getter function
|
|
2694
|
+
* @param {string} prop property name _optional_
|
|
2695
|
+
* @returns {Assertion}
|
|
2696
|
+
* @param {string} msg _optional_
|
|
2655
2697
|
* @namespace Assert
|
|
2656
2698
|
* @public
|
|
2657
2699
|
*/
|
|
@@ -2675,11 +2717,11 @@ assert.decreases = function (fn, obj, prop, msg) {
|
|
|
2675
2717
|
* assert.decreasesBy(fn, obj, 'val', 5);
|
|
2676
2718
|
*
|
|
2677
2719
|
* @name decreasesBy
|
|
2678
|
-
* @param {Function} modifier function
|
|
2679
|
-
* @param {
|
|
2680
|
-
* @param {
|
|
2681
|
-
* @param {
|
|
2682
|
-
* @param {
|
|
2720
|
+
* @param {Function} fn modifier function
|
|
2721
|
+
* @param {object} obj object or getter function
|
|
2722
|
+
* @param {string} prop property name _optional_
|
|
2723
|
+
* @param {number} delta change amount (delta)
|
|
2724
|
+
* @param {string} msg _optional_
|
|
2683
2725
|
* @namespace Assert
|
|
2684
2726
|
* @public
|
|
2685
2727
|
*/
|
|
@@ -2707,10 +2749,11 @@ assert.decreasesBy = function (fn, obj, prop, delta, msg) {
|
|
|
2707
2749
|
* assert.doesNotDecrease(fn, obj, 'val');
|
|
2708
2750
|
*
|
|
2709
2751
|
* @name doesNotDecrease
|
|
2710
|
-
* @param {Function} modifier function
|
|
2711
|
-
* @param {
|
|
2712
|
-
* @param {
|
|
2713
|
-
* @
|
|
2752
|
+
* @param {Function} fn modifier function
|
|
2753
|
+
* @param {object} obj object or getter function
|
|
2754
|
+
* @param {string} prop property name _optional_
|
|
2755
|
+
* @returns {Assertion}
|
|
2756
|
+
* @param {string} msg _optional_
|
|
2714
2757
|
* @namespace Assert
|
|
2715
2758
|
* @public
|
|
2716
2759
|
*/
|
|
@@ -2734,11 +2777,12 @@ assert.doesNotDecrease = function (fn, obj, prop, msg) {
|
|
|
2734
2777
|
* assert.doesNotDecreaseBy(fn, obj, 'val', 1);
|
|
2735
2778
|
*
|
|
2736
2779
|
* @name doesNotDecreaseBy
|
|
2737
|
-
* @param {Function} modifier function
|
|
2738
|
-
* @param {
|
|
2739
|
-
* @param {
|
|
2740
|
-
* @param {
|
|
2741
|
-
* @
|
|
2780
|
+
* @param {Function} fn modifier function
|
|
2781
|
+
* @param {object} obj object or getter function
|
|
2782
|
+
* @param {string} prop property name _optional_
|
|
2783
|
+
* @param {number} delta change amount (delta)
|
|
2784
|
+
* @returns {Assertion}
|
|
2785
|
+
* @param {string} msg _optional_
|
|
2742
2786
|
* @namespace Assert
|
|
2743
2787
|
* @public
|
|
2744
2788
|
*/
|
|
@@ -2766,11 +2810,11 @@ assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) {
|
|
|
2766
2810
|
* assert.decreasesButNotBy(fn, obj, 'val', 1);
|
|
2767
2811
|
*
|
|
2768
2812
|
* @name decreasesButNotBy
|
|
2769
|
-
* @param {Function} modifier function
|
|
2770
|
-
* @param {
|
|
2771
|
-
* @param {
|
|
2772
|
-
* @param {
|
|
2773
|
-
* @param {
|
|
2813
|
+
* @param {Function} fn modifier function
|
|
2814
|
+
* @param {object} obj object or getter function
|
|
2815
|
+
* @param {string} prop property name _optional_
|
|
2816
|
+
* @param {number} delta change amount (delta)
|
|
2817
|
+
* @param {string} msg _optional_
|
|
2774
2818
|
* @namespace Assert
|
|
2775
2819
|
* @public
|
|
2776
2820
|
*/
|
|
@@ -2799,7 +2843,7 @@ assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) {
|
|
|
2799
2843
|
* assert.ifError(err); // Rethrows err!
|
|
2800
2844
|
*
|
|
2801
2845
|
* @name ifError
|
|
2802
|
-
* @param {
|
|
2846
|
+
* @param {object} val
|
|
2803
2847
|
* @namespace Assert
|
|
2804
2848
|
* @public
|
|
2805
2849
|
*/
|
|
@@ -2818,8 +2862,8 @@ assert.ifError = function (val) {
|
|
|
2818
2862
|
*
|
|
2819
2863
|
* @name isExtensible
|
|
2820
2864
|
* @alias extensible
|
|
2821
|
-
* @param {
|
|
2822
|
-
* @param {
|
|
2865
|
+
* @param {object} obj
|
|
2866
|
+
* @param {string} msg _optional_
|
|
2823
2867
|
* @namespace Assert
|
|
2824
2868
|
* @public
|
|
2825
2869
|
*/
|
|
@@ -2842,8 +2886,8 @@ assert.isExtensible = function (obj, msg) {
|
|
|
2842
2886
|
*
|
|
2843
2887
|
* @name isNotExtensible
|
|
2844
2888
|
* @alias notExtensible
|
|
2845
|
-
* @param {
|
|
2846
|
-
* @param {
|
|
2889
|
+
* @param {object} obj
|
|
2890
|
+
* @param {string} msg _optional_
|
|
2847
2891
|
* @namespace Assert
|
|
2848
2892
|
* @public
|
|
2849
2893
|
*/
|
|
@@ -2865,8 +2909,8 @@ assert.isNotExtensible = function (obj, msg) {
|
|
|
2865
2909
|
*
|
|
2866
2910
|
* @name isSealed
|
|
2867
2911
|
* @alias sealed
|
|
2868
|
-
* @param {
|
|
2869
|
-
* @param {
|
|
2912
|
+
* @param {object} obj
|
|
2913
|
+
* @param {string} msg _optional_
|
|
2870
2914
|
* @namespace Assert
|
|
2871
2915
|
* @public
|
|
2872
2916
|
*/
|
|
@@ -2883,8 +2927,8 @@ assert.isSealed = function (obj, msg) {
|
|
|
2883
2927
|
*
|
|
2884
2928
|
* @name isNotSealed
|
|
2885
2929
|
* @alias notSealed
|
|
2886
|
-
* @param {
|
|
2887
|
-
* @param {
|
|
2930
|
+
* @param {object} obj
|
|
2931
|
+
* @param {string} msg _optional_
|
|
2888
2932
|
* @namespace Assert
|
|
2889
2933
|
* @public
|
|
2890
2934
|
*/
|
|
@@ -2903,8 +2947,8 @@ assert.isNotSealed = function (obj, msg) {
|
|
|
2903
2947
|
*
|
|
2904
2948
|
* @name isFrozen
|
|
2905
2949
|
* @alias frozen
|
|
2906
|
-
* @param {
|
|
2907
|
-
* @param {
|
|
2950
|
+
* @param {object} obj
|
|
2951
|
+
* @param {string} msg _optional_
|
|
2908
2952
|
* @namespace Assert
|
|
2909
2953
|
* @public
|
|
2910
2954
|
*/
|
|
@@ -2921,8 +2965,8 @@ assert.isFrozen = function (obj, msg) {
|
|
|
2921
2965
|
*
|
|
2922
2966
|
* @name isNotFrozen
|
|
2923
2967
|
* @alias notFrozen
|
|
2924
|
-
* @param {
|
|
2925
|
-
* @param {
|
|
2968
|
+
* @param {object} obj
|
|
2969
|
+
* @param {string} msg _optional_
|
|
2926
2970
|
* @namespace Assert
|
|
2927
2971
|
* @public
|
|
2928
2972
|
*/
|
|
@@ -2946,8 +2990,8 @@ assert.isNotFrozen = function (obj, msg) {
|
|
|
2946
2990
|
*
|
|
2947
2991
|
* @name isEmpty
|
|
2948
2992
|
* @alias empty
|
|
2949
|
-
* @param {
|
|
2950
|
-
* @param {
|
|
2993
|
+
* @param {object | Array | string | Map | Set} val
|
|
2994
|
+
* @param {string} msg _optional_
|
|
2951
2995
|
* @namespace Assert
|
|
2952
2996
|
* @public
|
|
2953
2997
|
*/
|
|
@@ -2971,8 +3015,8 @@ assert.isEmpty = function(val, msg) {
|
|
|
2971
3015
|
*
|
|
2972
3016
|
* @name isNotEmpty
|
|
2973
3017
|
* @alias notEmpty
|
|
2974
|
-
* @param {
|
|
2975
|
-
* @param {
|
|
3018
|
+
* @param {object | Array | string | Map | Set} val
|
|
3019
|
+
* @param {string} msg _optional_
|
|
2976
3020
|
* @namespace Assert
|
|
2977
3021
|
* @public
|
|
2978
3022
|
*/
|
|
@@ -2982,6 +3026,10 @@ assert.isNotEmpty = function(val, msg) {
|
|
|
2982
3026
|
|
|
2983
3027
|
/**
|
|
2984
3028
|
* Aliases.
|
|
3029
|
+
*
|
|
3030
|
+
* @param {unknown} name
|
|
3031
|
+
* @param {unknown} as
|
|
3032
|
+
* @returns {unknown}
|
|
2985
3033
|
*/
|
|
2986
3034
|
(function alias(name, as){
|
|
2987
3035
|
assert[as] = assert[name];
|