@@ -69,7 +69,7 @@ async function processFile(filePath, filesToProcess) {
69
69
if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
70
70
filesToProcess . push ( importedFile ) ;
71
71
}
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" ) {
73
73
let importedFile = path . resolve ( path . dirname ( filePath ) , node . declarations [ 0 ] . init . arguments [ 0 ] . value ) ;
74
74
importedFile = resolveFilePath ( importedFile , extension ) ;
75
75
if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
@@ -395,12 +395,14 @@ async function generateTestsForDirectory(args, processingFunction = 'getUnitTest
395
395
API . checkForAPIKey ( ) ;
396
396
queriedPath = path . resolve ( pathToProcess ) ;
397
397
rootPath = args . pythagora_root ;
398
- ( { screen , spinner , scrollableContent } = initScreenForUnitTests ( ) ) ;
398
+ console . log ( 'Processing folder structure...' ) ;
399
399
400
400
await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
401
401
processedFiles = [ ] ;
402
402
await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
403
403
processedFiles = [ ] ;
404
+ console . log ( 'Generating tests...' ) ;
405
+ ( { screen, spinner, scrollableContent } = initScreenForUnitTests ( ) ) ;
404
406
await traverseDirectory ( queriedPath , false , funcName , processingFunction ) ;
405
407
406
408
screen . destroy ( ) ;
0 commit comments