@@ -69,7 +69,7 @@ async function processFile(filePath, filesToProcess) {
6969 if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
7070 filesToProcess . push ( importedFile ) ;
7171 }
72- } else if ( node . type === "VariableDeclaration" && node . declarations [ 0 ] . init . type === "CallExpression" && node . declarations [ 0 ] . init . callee . name === "require" ) {
72+ } 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" ) {
7373 let importedFile = path . resolve ( path . dirname ( filePath ) , node . declarations [ 0 ] . init . arguments [ 0 ] . value ) ;
7474 importedFile = resolveFilePath ( importedFile , extension ) ;
7575 if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
@@ -395,12 +395,14 @@ async function generateTestsForDirectory(args, processingFunction = 'getUnitTest
395395 API . checkForAPIKey ( ) ;
396396 queriedPath = path . resolve ( pathToProcess ) ;
397397 rootPath = args . pythagora_root ;
398- ( { screen , spinner , scrollableContent } = initScreenForUnitTests ( ) ) ;
398+ console . log ( 'Processing folder structure...' ) ;
399399
400400 await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
401401 processedFiles = [ ] ;
402402 await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
403403 processedFiles = [ ] ;
404+ console . log ( 'Generating tests...' ) ;
405+ ( { screen, spinner, scrollableContent } = initScreenForUnitTests ( ) ) ;
404406 await traverseDirectory ( queriedPath , false , funcName , processingFunction ) ;
405407
406408 screen . destroy ( ) ;
0 commit comments