@@ -66,7 +66,7 @@ async function processFile(filePath, filesToProcess) {
66
66
if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
67
67
filesToProcess . push ( importedFile ) ;
68
68
}
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" ) {
70
70
let importedFile = path . resolve ( path . dirname ( filePath ) , node . declarations [ 0 ] . init . arguments [ 0 ] . value ) ;
71
71
importedFile = resolveFilePath ( importedFile , extension ) ;
72
72
if ( importedFile && ! filesToProcess . includes ( importedFile ) ) {
@@ -365,12 +365,14 @@ async function generateTestsForDirectory(args, processingFunction = 'getUnitTest
365
365
API . checkForAPIKey ( ) ;
366
366
queriedPath = path . resolve ( pathToProcess ) ;
367
367
rootPath = args . pythagora_root ;
368
- ( { screen , spinner , scrollableContent } = initScreenForUnitTests ( ) ) ;
368
+ console . log ( 'Processing folder structure...' ) ;
369
369
370
370
await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
371
371
processedFiles = [ ] ;
372
372
await traverseDirectory ( queriedPath , true , funcName , processingFunction ) ;
373
373
processedFiles = [ ] ;
374
+ console . log ( 'Generating tests...' ) ;
375
+ ( { screen, spinner, scrollableContent } = initScreenForUnitTests ( ) ) ;
374
376
await traverseDirectory ( queriedPath , false , funcName , processingFunction ) ;
375
377
376
378
screen . destroy ( ) ;
0 commit comments