@@ -9,7 +9,7 @@ describe('MongoMemoryServer', () => {
99 MongoMemoryServer = jest . requireActual ( '../MongoMemoryServer' ) . default ;
1010 } ) ;
1111
12- describe ( 'start' , ( ) => {
12+ describe ( 'start() ' , ( ) => {
1313 it ( 'should resolve to true if an MongoInstanceData is resolved by _startUpInstance' , async ( ) => {
1414 MongoMemoryServer . prototype . _startUpInstance = jest . fn ( ( ) => Promise . resolve ( { } as any ) ) ;
1515
@@ -65,7 +65,7 @@ describe('MongoMemoryServer', () => {
6565 } ) ;
6666 } ) ;
6767
68- describe ( 'getInstanceData' , ( ) => {
68+ describe ( 'getInstanceData() ' , ( ) => {
6969 it ( 'should throw an error if not instance is running after calling start' , async ( ) => {
7070 MongoMemoryServer . prototype . start = jest . fn ( ( ) => Promise . resolve ( true ) ) ;
7171
@@ -79,18 +79,18 @@ describe('MongoMemoryServer', () => {
7979 } ) ;
8080 } ) ;
8181
82- describe ( 'stop' , ( ) => {
83- it . only ( 'should stop mongod' , async ( ) => {
84- console . log ( MongoMemoryServer . prototype . _startUpInstance ) ;
82+ describe ( 'stop()' , ( ) => {
83+ it ( 'should stop mongod and answer on isRunning() method' , async ( ) => {
8584 const mongod = new MongoMemoryServer ( {
8685 autoStart : true ,
87- debug : true ,
86+ debug : false ,
8887 } ) ;
8988
9089 await mongod . getInstanceData ( ) ;
9190
91+ expect ( mongod . isRunning ( ) ) . toBeTruthy ( ) ;
9292 await mongod . stop ( ) ;
93- expect ( mongod . runningInstance ) . toBe ( null ) ;
93+ expect ( mongod . isRunning ( ) ) . toBeFalsy ( ) ;
9494 } ) ;
9595 } ) ;
9696} ) ;
0 commit comments