diff --git a/integration-tests/list_directory.test.js b/integration-tests/list_directory.test.js index 987a2351..6bbcde63 100644 --- a/integration-tests/list_directory.test.js +++ b/integration-tests/list_directory.test.js @@ -13,6 +13,7 @@ test('should be able to list a directory', async (t) => { rig.setup(t.name); rig.createFile('file1.txt', 'file 1 content'); rig.mkdir('subdir'); + rig.sync(); const prompt = `Can you list the files in the current directory`; const result = await rig.run(prompt); diff --git a/integration-tests/test-helper.js b/integration-tests/test-helper.js index acc0035a..eb598bd9 100644 --- a/integration-tests/test-helper.js +++ b/integration-tests/test-helper.js @@ -42,6 +42,11 @@ export class TestRig { mkdirSync(join(this.testDir, dir)); } + sync() { + // ensure file system is done before spawning + execSync('sync', { cwd: this.testDir }); + } + run(prompt, ...args) { const output = execSync( `node ${this.bundlePath} --yolo --prompt "${prompt}" ${args.join(' ')}`,