@@ -64,38 +64,40 @@ module.exports = function (chai, util) {
64
64
} ;
65
65
66
66
/**
67
- * ### .ok (object, [message])
67
+ * ### .isOk (object, [message])
68
68
*
69
69
* Asserts that `object` is truthy.
70
70
*
71
- * assert.ok ('everything', 'everything is ok');
72
- * assert.ok (false, 'this will fail');
71
+ * assert.isOk ('everything', 'everything is ok');
72
+ * assert.isOk (false, 'this will fail');
73
73
*
74
- * @name ok
74
+ * @name isOk
75
+ * @alias ok
75
76
* @param {Mixed } object to test
76
77
* @param {String } message
77
78
* @api public
78
79
*/
79
80
80
- assert . ok = function ( val , msg ) {
81
+ assert . isOk = function ( val , msg ) {
81
82
new Assertion ( val , msg ) . is . ok ;
82
83
} ;
83
84
84
85
/**
85
- * ### .notOk (object, [message])
86
+ * ### .isNotOk (object, [message])
86
87
*
87
88
* Asserts that `object` is falsy.
88
89
*
89
- * assert.notOk ('everything', 'this will fail');
90
- * assert.notOk (false, 'this will pass');
90
+ * assert.isNotOk ('everything', 'this will fail');
91
+ * assert.isNotOk (false, 'this will pass');
91
92
*
92
- * @name notOk
93
+ * @name isNotOk
94
+ * @alias notOk
93
95
* @param {Mixed } object to test
94
96
* @param {String } message
95
97
* @api public
96
98
*/
97
99
98
- assert . notOk = function ( val , msg ) {
100
+ assert . isNotOk = function ( val , msg ) {
99
101
new Assertion ( val , msg ) . is . not . ok ;
100
102
} ;
101
103
@@ -964,11 +966,11 @@ module.exports = function (chai, util) {
964
966
* `constructor`, or alternately that it will throw an error with message
965
967
* matching `regexp`.
966
968
*
967
- * assert.throw (fn, 'function throws a reference error');
968
- * assert.throw (fn, /function throws a reference error/);
969
- * assert.throw (fn, ReferenceError);
970
- * assert.throw (fn, ReferenceError, 'function throws a reference error');
971
- * assert.throw (fn, ReferenceError, /function throws a reference error/);
969
+ * assert.throws (fn, 'function throws a reference error');
970
+ * assert.throws (fn, /function throws a reference error/);
971
+ * assert.throws (fn, ReferenceError);
972
+ * assert.throws (fn, ReferenceError, 'function throws a reference error');
973
+ * assert.throws (fn, ReferenceError, /function throws a reference error/);
972
974
*
973
975
* @name throws
974
976
* @alias throw
@@ -981,13 +983,13 @@ module.exports = function (chai, util) {
981
983
* @api public
982
984
*/
983
985
984
- assert . Throw = function ( fn , errt , errs , msg ) {
986
+ assert . throws = function ( fn , errt , errs , msg ) {
985
987
if ( 'string' === typeof errt || errt instanceof RegExp ) {
986
988
errs = errt ;
987
989
errt = null ;
988
990
}
989
991
990
- var assertErr = new Assertion ( fn , msg ) . to . Throw ( errt , errs ) ;
992
+ var assertErr = new Assertion ( fn , msg ) . to . throw ( errt , errs ) ;
991
993
return flag ( assertErr , 'object' ) ;
992
994
} ;
993
995
@@ -1277,7 +1279,7 @@ module.exports = function (chai, util) {
1277
1279
* ### .ifError(object)
1278
1280
*
1279
1281
* Asserts if value is not a false value, and throws if it is a true value.
1280
- * This is added to allow for chai to be a drop-in replacement for Node's
1282
+ * This is added to allow for chai to be a drop-in replacement for Node's
1281
1283
* assert class.
1282
1284
*
1283
1285
* var err = new Error('I am a custom error');
@@ -1295,117 +1297,123 @@ module.exports = function (chai, util) {
1295
1297
} ;
1296
1298
1297
1299
/**
1298
- * ### .extensible (object)
1300
+ * ### .isExtensible (object)
1299
1301
*
1300
1302
* Asserts that `object` is extensible (can have new properties added to it).
1301
1303
*
1302
- * assert.extensible ({});
1304
+ * assert.isExtensible ({});
1303
1305
*
1304
- * @name extensible
1306
+ * @name isExtensible
1307
+ * @alias extensible
1305
1308
* @param {Object } object
1306
1309
* @param {String } message _optional_
1307
1310
* @api public
1308
1311
*/
1309
1312
1310
- assert . extensible = function ( obj , msg ) {
1313
+ assert . isExtensible = function ( obj , msg ) {
1311
1314
new Assertion ( obj , msg ) . to . be . extensible ;
1312
1315
} ;
1313
1316
1314
1317
/**
1315
- * ### .notExtensible (object)
1318
+ * ### .isNotExtensible (object)
1316
1319
*
1317
1320
* Asserts that `object` is _not_ extensible.
1318
1321
*
1319
1322
* var nonExtensibleObject = Object.preventExtensions({});
1320
1323
* var sealedObject = Object.seal({});
1321
1324
* var frozenObject = Object.freese({});
1322
1325
*
1323
- * assert.notExtensible (nonExtensibleObject);
1324
- * assert.notExtensible (sealedObject);
1325
- * assert.notExtensible (frozenObject);
1326
+ * assert.isNotExtensible (nonExtensibleObject);
1327
+ * assert.isNotExtensible (sealedObject);
1328
+ * assert.isNotExtensible (frozenObject);
1326
1329
*
1327
- * @name notExtensible
1330
+ * @name isNotExtensible
1331
+ * @alias notExtensible
1328
1332
* @param {Object } object
1329
1333
* @param {String } message _optional_
1330
1334
* @api public
1331
1335
*/
1332
1336
1333
- assert . notExtensible = function ( obj , msg ) {
1337
+ assert . isNotExtensible = function ( obj , msg ) {
1334
1338
new Assertion ( obj , msg ) . to . not . be . extensible ;
1335
1339
} ;
1336
1340
1337
1341
/**
1338
- * ### .sealed (object)
1342
+ * ### .isSealed (object)
1339
1343
*
1340
1344
* Asserts that `object` is sealed (cannot have new properties added to it
1341
1345
* and its existing properties cannot be removed).
1342
1346
*
1343
1347
* var sealedObject = Object.seal({});
1344
1348
* var frozenObject = Object.seal({});
1345
1349
*
1346
- * assert.sealed (sealedObject);
1347
- * assert.sealed (frozenObject);
1350
+ * assert.isSealed (sealedObject);
1351
+ * assert.isSealed (frozenObject);
1348
1352
*
1349
- * @name sealed
1353
+ * @name isSealed
1354
+ * @alias sealed
1350
1355
* @param {Object } object
1351
1356
* @param {String } message _optional_
1352
1357
* @api public
1353
1358
*/
1354
1359
1355
- assert . sealed = function ( obj , msg ) {
1360
+ assert . isSealed = function ( obj , msg ) {
1356
1361
new Assertion ( obj , msg ) . to . be . sealed ;
1357
1362
} ;
1358
1363
1359
1364
/**
1360
- * ### .notSealed (object)
1365
+ * ### .isNotSealed (object)
1361
1366
*
1362
1367
* Asserts that `object` is _not_ sealed.
1363
1368
*
1364
- * assert.notSealed ({});
1369
+ * assert.isNotSealed ({});
1365
1370
*
1366
- * @name notSealed
1371
+ * @name isNotSealed
1372
+ * @alias notSealed
1367
1373
* @param {Object } object
1368
1374
* @param {String } message _optional_
1369
1375
* @api public
1370
1376
*/
1371
1377
1372
- assert . notSealed = function ( obj , msg ) {
1378
+ assert . isNotSealed = function ( obj , msg ) {
1373
1379
new Assertion ( obj , msg ) . to . not . be . sealed ;
1374
1380
} ;
1375
1381
1376
1382
/**
1377
- * ### .frozen (object)
1383
+ * ### .isFrozen (object)
1378
1384
*
1379
1385
* Asserts that `object` is frozen (cannot have new properties added to it
1380
1386
* and its existing properties cannot be modified).
1381
1387
*
1382
1388
* var frozenObject = Object.freeze({});
1383
1389
* assert.frozen(frozenObject);
1384
1390
*
1385
- * @name frozen
1391
+ * @name isFrozen
1392
+ * @alias frozen
1386
1393
* @param {Object } object
1387
1394
* @param {String } message _optional_
1388
1395
* @api public
1389
1396
*/
1390
1397
1391
- assert . frozen = function ( obj , msg ) {
1398
+ assert . isFrozen = function ( obj , msg ) {
1392
1399
new Assertion ( obj , msg ) . to . be . frozen ;
1393
1400
} ;
1394
1401
1395
1402
/**
1396
- * ### .notFrozen (object)
1403
+ * ### .isNotFrozen (object)
1397
1404
*
1398
1405
* Asserts that `object` is _not_ frozen.
1399
1406
*
1400
- * assert.notFrozen ({});
1407
+ * assert.isNotFrozen ({});
1401
1408
*
1402
- * @name notSealed
1409
+ * @name isNotFrozen
1410
+ * @alias notFrozen
1403
1411
* @param {Object } object
1404
1412
* @param {String } message _optional_
1405
1413
* @api public
1406
1414
*/
1407
1415
1408
- assert . notFrozen = function ( obj , msg ) {
1416
+ assert . isNotFrozen = function ( obj , msg ) {
1409
1417
new Assertion ( obj , msg ) . to . not . be . frozen ;
1410
1418
} ;
1411
1419
@@ -1417,6 +1425,14 @@ module.exports = function (chai, util) {
1417
1425
assert [ as ] = assert [ name ] ;
1418
1426
return alias ;
1419
1427
} )
1420
- ( 'Throw' , 'throw' )
1421
- ( 'Throw' , 'throws' ) ;
1428
+ ( 'isOk' , 'ok' )
1429
+ ( 'isNotOk' , 'notOk' )
1430
+ ( 'throws' , 'throw' )
1431
+ ( 'throws' , 'Throw' )
1432
+ ( 'isExtensible' , 'extensible' )
1433
+ ( 'isNotExtensible' , 'notExtensible' )
1434
+ ( 'isSealed' , 'sealed' )
1435
+ ( 'isNotSealed' , 'notSealed' )
1436
+ ( 'isFrozen' , 'frozen' )
1437
+ ( 'isNotFrozen' , 'notFrozen' ) ;
1422
1438
} ;
0 commit comments