@@ -66,7 +66,7 @@ async function processFile(filePath, filesToProcess) {
6666 if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
6767 filesToProcess . push ( importedFile ) ;
6868 }
69- } else if ( node . type === "VariableDeclaration" && node . declarations [ 0 ] . init . type === "CallExpression" && node . declarations [ 0 ] . init . callee . name === "require" ) {
69+ } else if ( node . type === "VariableDeclaration" && node . declarations . length > 0 && node . declarations [ 0 ] . init && node . declarations [ 0 ] . init . type === "CallExpression" && node . declarations [ 0 ] . init . callee . name === "require" ) {
7070 let importedFile = path . resolve ( path . dirname ( filePath ) , node . declarations [ 0 ] . init . arguments [ 0 ] . value ) ;
7171 importedFile = resolveFilePath ( importedFile , extension ) ;
7272 if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
@@ -365,12 +365,14 @@ async function generateTestsForDirectory(args, processingFunction = 'getUnitTest
365365 API . checkForAPIKey ( ) ;
366366 queriedPath = path . resolve ( pathToProcess ) ;
367367 rootPath = args . pythagora_root ;
368- ( { screen , spinner , scrollableContent } = initScreenForUnitTests ( ) ) ;
368+ console . log ( 'Processing folder structure...' ) ;
369369
370370 await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
371371 processedFiles = [ ] ;
372372 await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
373373 processedFiles = [ ] ;
374+ console . log ( 'Generating tests...' ) ;
375+ ( { screen, spinner, scrollableContent } = initScreenForUnitTests ( ) ) ;
374376 await traverseDirectory ( queriedPath , false , funcName , processingFunction ) ;
375377
376378 screen . destroy ( ) ;
0 commit comments