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() {
423423 theDatabase
424424 . collection ( 'resumetokenProjectedOutCallback' )
425425 . 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 ) ;
428428 } ) ;
429- } ) ;
429+ } , 250 ) ;
430430
431431 // 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 ;
435434
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 ) ) ;
446437 } ) ;
447438 } ) ;
448439 }
@@ -471,11 +462,7 @@ describe('Change Streams', function() {
471462 } ) ;
472463
473464 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 ;
479466 thisChangeStream . close ( ( ) => client . close ( done ) ) ;
480467 } ) ;
481468
You can’t perform that action at this time.
0 commit comments