@@ -24,7 +24,7 @@ describe('The Security module', function () {
2424 sendDependencies : this . sandbox . spy ( )
2525 }
2626
27- this . sandbox . stub ( fs , 'readFile' , function ( file , callback ) {
27+ this . sandbox . stub ( fs , 'readFile' ) . callsFake ( function ( file , callback ) {
2828 if ( file === '.snyk' ) {
2929 callback ( null , new Buffer (
3030 'version: v9.9.9\n' +
@@ -39,7 +39,7 @@ describe('The Security module', function () {
3939 callback ( new Error ( 'not implemented' ) )
4040 } )
4141
42- this . sandbox . stub ( childProcess , 'execFile' , function ( cmd , args , opts , callback ) {
42+ this . sandbox . stub ( childProcess , 'execFile' ) . callsFake ( function ( cmd , args , opts , callback ) {
4343 if ( typeof opts === 'function' ) {
4444 callback = opts
4545 }
@@ -55,7 +55,7 @@ describe('The Security module', function () {
5555 callback ( new Error ( 'not implemented' ) )
5656 } )
5757
58- this . sandbox . stub ( fs , 'readdir' , function ( dir , callback ) {
58+ this . sandbox . stub ( fs , 'readdir' ) . callsFake ( function ( dir , callback ) {
5959 if ( dir === '/project/node_modules/vuln' ) {
6060 callback ( null , [
6161 'package.json' ,
@@ -113,11 +113,11 @@ describe('The Security module', function () {
113113 sendDependencies : this . sandbox . spy ( )
114114 }
115115
116- this . sandbox . stub ( fs , 'readFile' , function ( file , callback ) {
116+ this . sandbox . stub ( fs , 'readFile' ) . callsFake ( function ( file , callback ) {
117117 callback ( new Error ( 'ENOENT' ) )
118118 } )
119119
120- this . sandbox . stub ( childProcess , 'execFile' , function ( cmd , args , opts , callback ) {
120+ this . sandbox . stub ( childProcess , 'execFile' ) . callsFake ( function ( cmd , args , opts , callback ) {
121121 if ( args . indexOf ( '--json' ) > - 1 ) {
122122 callback ( null , JSON . stringify ( { dependencies : dependencies } ) )
123123 return
@@ -156,7 +156,7 @@ describe('The Security module', function () {
156156 sendDependencies : this . sandbox . spy ( )
157157 }
158158
159- this . sandbox . stub ( fs , 'readFile' , function ( file , callback ) {
159+ this . sandbox . stub ( fs , 'readFile' ) . callsFake ( function ( file , callback ) {
160160 if ( file === '.snyk' ) {
161161 callback ( null , new Buffer (
162162 'version: v9.9.9\n' +
@@ -168,7 +168,7 @@ describe('The Security module', function () {
168168 callback ( new Error ( 'not implemented' ) )
169169 } )
170170
171- this . sandbox . stub ( childProcess , 'execFile' , function ( cmd , args , opts , callback ) {
171+ this . sandbox . stub ( childProcess , 'execFile' ) . callsFake ( function ( cmd , args , opts , callback ) {
172172 if ( args . indexOf ( '--json' ) > - 1 ) {
173173 callback ( null , JSON . stringify ( { dependencies : dependencies } ) )
174174 return
@@ -207,7 +207,7 @@ describe('The Security module', function () {
207207 sendDependencies : this . sandbox . spy ( )
208208 }
209209
210- this . sandbox . stub ( fs , 'readFile' , function ( file , callback ) {
210+ this . sandbox . stub ( fs , 'readFile' ) . callsFake ( function ( file , callback ) {
211211 if ( file === '.snyk' ) {
212212 callback ( null , new Buffer (
213213 'version: v9.9.9\n' +
@@ -219,7 +219,7 @@ describe('The Security module', function () {
219219 callback ( new Error ( 'not implemented' ) )
220220 } )
221221
222- this . sandbox . stub ( childProcess , 'execFile' , function ( cmd , args , opts , callback ) {
222+ this . sandbox . stub ( childProcess , 'execFile' ) . callsFake ( function ( cmd , args , opts , callback ) {
223223 if ( args . indexOf ( '--json' ) > - 1 ) {
224224 callback ( null , JSON . stringify ( { dependencies : dependencies } ) )
225225 return
0 commit comments