@@ -5,6 +5,11 @@ import MongoInstance from '../MongoInstance';
55
66jasmine . DEFAULT_TIMEOUT_INTERVAL = 600000 ;
77
8+ // TODO: return back `latest` version when it will be fixed in MongoDB distro (for now use 4.0.3 😂)
9+ // more details in https://github.com/nodkz/mongodb-memory-server/issues/131
10+ // const latestVersion = 'latest';
11+ const latestVersion = '4.0.3' ;
12+
813let tmpDir ;
914beforeEach ( ( ) => {
1015 tmp . setGracefulCleanup ( ) ;
@@ -94,7 +99,7 @@ describe('MongoInstance', () => {
9499 it ( 'should start instance on port 27333' , async ( ) => {
95100 const mongod = await MongoInstance . run ( {
96101 instance : { port : 27333 , dbPath : tmpDir . name } ,
97- binary : { version : 'latest' } ,
102+ binary : { version : latestVersion } ,
98103 } ) ;
99104
100105 expect ( mongod . getPid ( ) ) . toBeGreaterThan ( 0 ) ;
@@ -105,13 +110,13 @@ describe('MongoInstance', () => {
105110 it ( 'should throw error if port is busy' , async ( ) => {
106111 const mongod = await MongoInstance . run ( {
107112 instance : { port : 27444 , dbPath : tmpDir . name } ,
108- binary : { version : 'latest' } ,
113+ binary : { version : latestVersion } ,
109114 } ) ;
110115
111116 await expect (
112117 MongoInstance . run ( {
113118 instance : { port : 27444 , dbPath : tmpDir . name } ,
114- binary : { version : 'latest' } ,
119+ binary : { version : latestVersion } ,
115120 } )
116121 ) . rejects . toBeDefined ( ) ;
117122
@@ -121,7 +126,7 @@ describe('MongoInstance', () => {
121126 it ( 'should await while mongo is killed' , async ( ) => {
122127 const mongod = await MongoInstance . run ( {
123128 instance : { port : 27445 , dbPath : tmpDir . name } ,
124- binary : { version : 'latest' } ,
129+ binary : { version : latestVersion } ,
125130 } ) ;
126131 const pid : any = mongod . getPid ( ) ;
127132 const killerPid : any = mongod . killerProcess . pid ;
0 commit comments