Flaky test (#1405)

Co-authored-by: matt korwel <matt.korwel@gmail.com>
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
This commit is contained in:
Keith Ballinger 2025-06-25 21:45:39 -07:00 committed by GitHub
parent dbe217828d
commit 891116a6c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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(' ')}`,