diff --git a/packages/aws-cdk/test/init.test.ts b/packages/aws-cdk/test/init.test.ts index 08764756..ffd46939 100644 --- a/packages/aws-cdk/test/init.test.ts +++ b/packages/aws-cdk/test/init.test.ts @@ -190,6 +190,29 @@ describe('constructs version', () => { workDir, }); + console.log('workDir', workDir); + + // Function to recursively list directory contents + async function recursiveListFiles(rdir: string): Promise { + const ret = new Array(); + await recurse(rdir); + return ret; + + async function recurse(dir: string) { + for (const name of await fs.readdir(dir)) { + const fullPath = path.join(dir, name); + if ((await fs.stat(fullPath)).isDirectory()) { + await recurse(fullPath); + } else { + ret.push(fullPath); + } + } + } + } + + // Log the directory contents + console.log('Directory contents:', await recursiveListFiles(workDir)); + // Check that package.json and bin/ got created in the current directory expect(await fs.pathExists(path.join(workDir, 'package.json'))).toBeTruthy(); expect(await fs.pathExists(path.join(workDir, 'bin'))).toBeTruthy();