@@ -596,8 +596,8 @@ describe('Bulk', function () {
596
596
var col = db . collection ( 'batch_write_ordered_ops_8' ) ;
597
597
598
598
col . initializeOrderedBulkOp ( ) . execute ( function ( err ) {
599
- test . equal ( err instanceof Error , true ) ;
600
- test . equal ( err . message , 'Invalid Operation, no operations specified ' ) ;
599
+ expect ( err ) . to . be . instanceOf ( TypeError ) ;
600
+ expect ( err ) . to . have . property ( ' message' , 'Invalid BulkOperation, Batch cannot be empty ' ) ;
601
601
602
602
client . close ( done ) ;
603
603
} ) ;
@@ -1105,8 +1105,8 @@ describe('Bulk', function () {
1105
1105
col
1106
1106
. initializeUnorderedBulkOp ( )
1107
1107
. execute ( self . configuration . writeConcernMax ( ) , function ( err ) {
1108
- test . equal ( err instanceof Error , true ) ;
1109
- test . equal ( err . message , 'Invalid Operation, no operations specified ' ) ;
1108
+ expect ( err ) . to . be . instanceOf ( TypeError ) ;
1109
+ expect ( err ) . to . have . property ( ' message' , 'Invalid BulkOperation, Batch cannot be empty ' ) ;
1110
1110
1111
1111
client . close ( done ) ;
1112
1112
} ) ;
@@ -1516,8 +1516,9 @@ describe('Bulk', function () {
1516
1516
client . connect ( function ( err , client ) {
1517
1517
var db = client . db ( self . configuration . db ) ;
1518
1518
db . collection ( 'doesnt_matter' ) . insertMany ( [ ] , function ( err ) {
1519
- test . equal ( err instanceof Error , true ) ;
1520
- test . equal ( err . message , 'Invalid Operation, no operations specified' ) ;
1519
+ expect ( err ) . to . be . instanceOf ( TypeError ) ;
1520
+ expect ( err ) . to . have . property ( 'message' , 'Invalid BulkOperation, Batch cannot be empty' ) ;
1521
+
1521
1522
client . close ( done ) ;
1522
1523
} ) ;
1523
1524
} ) ;
@@ -1536,8 +1537,9 @@ describe('Bulk', function () {
1536
1537
client . connect ( function ( err , client ) {
1537
1538
var db = client . db ( self . configuration . db ) ;
1538
1539
db . collection ( 'doesnt_matter' ) . insertMany ( [ ] , { ordered : false } , function ( err ) {
1539
- test . equal ( err instanceof Error , true ) ;
1540
- test . equal ( err . message , 'Invalid Operation, no operations specified' ) ;
1540
+ expect ( err ) . to . be . instanceOf ( TypeError ) ;
1541
+ expect ( err ) . to . have . property ( 'message' , 'Invalid BulkOperation, Batch cannot be empty' ) ;
1542
+
1541
1543
client . close ( done ) ;
1542
1544
} ) ;
1543
1545
} ) ;
@@ -1559,8 +1561,8 @@ describe('Bulk', function () {
1559
1561
test . equal ( false , true ) ; // this should not happen!
1560
1562
} )
1561
1563
. catch ( function ( err ) {
1562
- test . equal ( err instanceof Error , true ) ;
1563
- test . equal ( err . message , 'Invalid Operation, no operations specified ' ) ;
1564
+ expect ( err ) . to . be . instanceOf ( TypeError ) ;
1565
+ expect ( err ) . to . have . property ( ' message' , 'Invalid BulkOperation, Batch cannot be empty ' ) ;
1564
1566
} )
1565
1567
. then ( function ( ) {
1566
1568
return client . close ( ) ;
0 commit comments