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:
parent
dbe217828d
commit
891116a6c2
|
@ -13,6 +13,7 @@ test('should be able to list a directory', async (t) => {
|
||||||
rig.setup(t.name);
|
rig.setup(t.name);
|
||||||
rig.createFile('file1.txt', 'file 1 content');
|
rig.createFile('file1.txt', 'file 1 content');
|
||||||
rig.mkdir('subdir');
|
rig.mkdir('subdir');
|
||||||
|
rig.sync();
|
||||||
|
|
||||||
const prompt = `Can you list the files in the current directory`;
|
const prompt = `Can you list the files in the current directory`;
|
||||||
const result = await rig.run(prompt);
|
const result = await rig.run(prompt);
|
||||||
|
|
|
@ -42,6 +42,11 @@ export class TestRig {
|
||||||
mkdirSync(join(this.testDir, dir));
|
mkdirSync(join(this.testDir, dir));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync() {
|
||||||
|
// ensure file system is done before spawning
|
||||||
|
execSync('sync', { cwd: this.testDir });
|
||||||
|
}
|
||||||
|
|
||||||
run(prompt, ...args) {
|
run(prompt, ...args) {
|
||||||
const output = execSync(
|
const output = execSync(
|
||||||
`node ${this.bundlePath} --yolo --prompt "${prompt}" ${args.join(' ')}`,
|
`node ${this.bundlePath} --yolo --prompt "${prompt}" ${args.join(' ')}`,
|
||||||
|
|
Loading…
Reference in New Issue