@@ -37,6 +37,7 @@ function cleanupTestDir(testDir) {
3737 fs . unlinkSync ( fullPath ) ;
3838 } catch ( e ) {
3939 // Ignore
40+ console . log ( `Error deleting file ${ fullPath } : ${ e . message } ` ) ;
4041 }
4142 }
4243 }
@@ -306,12 +307,12 @@ test('CLI script imports and executes library CLI', async () => {
306307 // Create mock CLI module that matches the actual structure
307308 const mockCLI = `
308309 // Mock implementation of the CLI
309- function runZeroUiInit() {
310+ async function runZeroUiInit() {
310311 console.log('Mock CLI executed successfully');
311312 }
312313
313314 function cli(argv = process.argv.slice(2)) {
314- runZeroUiInit(argv);
315+ await runZeroUiInit(argv);
315316 return Promise.resolve();
316317 }
317318
@@ -406,7 +407,7 @@ export function TestComponent() {
406407 process . chdir ( testDir ) ;
407408
408409 try {
409- runZeroUiInit ( ) ;
410+ await runZeroUiInit ( ) ;
410411
411412 // Check that initialization messages were logged
412413 const logOutput = logMessages . join ( '\n' ) ;
@@ -454,7 +455,7 @@ test('Library CLI handles errors gracefully', async () => {
454455 const { runZeroUiInit } = require ( '../../src/cli/postInstall.cjs' ) ;
455456
456457 // This should complete without errors in most cases
457- runZeroUiInit ( ) ;
458+ await runZeroUiInit ( ) ;
458459
459460 console . log ( '✅ Library CLI handles execution without crashing' ) ;
460461
@@ -723,7 +724,7 @@ export function Toggle() {
723724 process . chdir ( testDir ) ;
724725
725726 try {
726- runZeroUiInit ( ) ;
727+ await runZeroUiInit ( ) ;
727728
728729 const logOutput = logMessages . join ( '\n' ) ;
729730 assert ( logOutput . includes ( '[Zero-UI] Initializing...' ) , 'Should log initialization' ) ;
0 commit comments