File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/mongodb-memory-server-core/src/util/__tests__ Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,30 @@ describe('MongodbInstance', () => {
390390 }
391391 } ) ;
392392
393+ it ( 'should not emit "instanceError" with 0 or 12 exit code on windows' , ( ) => {
394+ Object . defineProperty ( process , 'platform' , {
395+ value : 'win32' ,
396+ } ) ;
397+
398+ // test code 0
399+ {
400+ events . clear ( ) ;
401+ mongod . closeHandler ( 0 , null ) ;
402+
403+ expect ( events . size ) . toEqual ( 1 ) ;
404+ expect ( events . get ( MongoInstanceEvents . instanceClosed ) ) . toEqual ( [ 0 , null ] ) ;
405+ }
406+
407+ // test code 12
408+ {
409+ events . clear ( ) ;
410+ mongod . closeHandler ( 12 , null ) ;
411+
412+ expect ( events . size ) . toEqual ( 1 ) ;
413+ expect ( events . get ( MongoInstanceEvents . instanceClosed ) ) . toEqual ( [ 12 , null ] ) ;
414+ }
415+ } ) ;
416+
393417 it ( '"closeHandler" should emit "instanceError" with vc_redist helper message on windows on high exit code' , ( ) => {
394418 events . clear ( ) ;
395419 Object . defineProperty ( process , 'platform' , {
You can’t perform that action at this time.
0 commit comments