File tree Expand file tree Collapse file tree 1 file changed +8
-21
lines changed Expand file tree Collapse file tree 1 file changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -423,26 +423,17 @@ describe('Change Streams', function() {
423
423
theDatabase
424
424
. collection ( 'resumetokenProjectedOutCallback' )
425
425
. insert ( { b : 2 } , function ( err , result ) {
426
- assert . ifError ( err ) ;
427
- assert . equal ( result . insertedCount , 1 ) ;
426
+ expect ( err ) . to . not . exist ;
427
+ expect ( result . insertedCount ) . to . equal ( 1 ) ;
428
428
} ) ;
429
- } ) ;
429
+ } , 250 ) ;
430
430
431
431
// Fetch the change notification
432
- thisChangeStream . hasNext ( function ( err , hasNext ) {
433
- assert . ifError ( err ) ;
434
- assert . equal ( true , hasNext ) ;
432
+ thisChangeStream . next ( function ( err ) {
433
+ expect ( err ) . to . exist ;
435
434
436
- thisChangeStream . next ( function ( err ) {
437
- assert . ok ( err ) ;
438
- assert . equal (
439
- err . message ,
440
- 'A change stream document has been received that lacks a resume token (_id).'
441
- ) ;
442
-
443
- // Close the change stream
444
- thisChangeStream . close ( ) . then ( ( ) => client . close ( done ) ) ;
445
- } ) ;
435
+ // Close the change stream
436
+ thisChangeStream . close ( ) . then ( ( ) => client . close ( done ) ) ;
446
437
} ) ;
447
438
} ) ;
448
439
}
@@ -471,11 +462,7 @@ describe('Change Streams', function() {
471
462
} ) ;
472
463
473
464
thisChangeStream . on ( 'error' , function ( err ) {
474
- assert . equal (
475
- err . message ,
476
- 'A change stream document has been received that lacks a resume token (_id).'
477
- ) ;
478
-
465
+ expect ( err ) . to . exist ;
479
466
thisChangeStream . close ( ( ) => client . close ( done ) ) ;
480
467
} ) ;
481
468
You can’t perform that action at this time.
0 commit comments