File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import mkdirp from 'mkdirp';
88import findCacheDir from 'find-cache-dir' ;
99import { execSync } from 'child_process' ;
1010import dedent from 'dedent' ;
11+ import { promisify } from 'util' ;
1112import MongoBinaryDownload from './MongoBinaryDownload' ;
1213
1314export type MongoBinaryCache = {
@@ -30,12 +31,12 @@ export default class MongoBinary {
3031 let binaryPath : string = '' ;
3132
3233 try {
33- await fs . access ( systemBinary ) ;
34+ await promisify ( fs . access ) ( systemBinary ) ;
3435
3536 this . debug ( `MongoBinary: found sytem binary path at ${ systemBinary } ` ) ;
3637 binaryPath = systemBinary ;
3738 } catch ( err ) {
38- this . debug ( `MongoBinary: can't find system binary at ${ systemBinary } ` ) ;
39+ this . debug ( `MongoBinary: can't find system binary at ${ systemBinary } . ${ err . message } ` ) ;
3940 }
4041
4142 return binaryPath ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ describe('MongoBinary', () => {
3939 process . env . MONGOMS_SYSTEM_BINARY = '/usr/local/bin/mongod' ;
4040 await MongoBinary . getPath ( ) ;
4141
42- expect ( accessSpy ) . toHaveBeenCalledWith ( '/usr/local/bin/mongod' ) ;
42+ expect ( accessSpy ) . toHaveBeenCalledWith ( '/usr/local/bin/mongod' , expect . any ( Function ) ) ;
4343
4444 accessSpy . mockClear ( ) ;
4545 } ) ;
@@ -81,7 +81,7 @@ describe('MongoBinary', () => {
8181 const accessSpy = jest . spyOn ( fs , 'access' ) ;
8282 await MongoBinary . getSystemPath ( '/usr/bin/mongod' ) ;
8383
84- expect ( accessSpy ) . toHaveBeenCalledWith ( '/usr/bin/mongod' ) ;
84+ expect ( accessSpy ) . toHaveBeenCalledWith ( '/usr/bin/mongod' , expect . any ( Function ) ) ;
8585
8686 accessSpy . mockClear ( ) ;
8787 } ) ;
You can’t perform that action at this time.
0 commit comments