File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/vitest/src/runtime
test/core/__mocks__/axios Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -312,10 +312,10 @@ export class VitestMocker {
312312 return null
313313 }
314314
315- const files = readdirSync ( mockFolder )
316315 const baseOriginal = basename ( path )
317316
318- function findFile ( files : string [ ] , baseOriginal : string ) : string | null {
317+ function findFile ( mockFolder : string , baseOriginal : string ) : string | null {
318+ const files = readdirSync ( mockFolder )
319319 for ( const file of files ) {
320320 const baseFile = basename ( file , extname ( file ) )
321321 if ( baseFile === baseOriginal ) {
@@ -326,7 +326,7 @@ export class VitestMocker {
326326 }
327327 else {
328328 // find folder/index.{js,ts}
329- const indexFile = findFile ( readdirSync ( path ) , 'index' )
329+ const indexFile = findFile ( path , 'index' )
330330 if ( indexFile ) {
331331 return indexFile
332332 }
@@ -336,7 +336,7 @@ export class VitestMocker {
336336 return null
337337 }
338338
339- return findFile ( files , baseOriginal )
339+ return findFile ( mockFolder , baseOriginal )
340340 }
341341
342342 const dir = dirname ( path )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments