Skip to content

Commit

Permalink
ugh
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Jul 25, 2024
1 parent 2d775db commit 383ec7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/parallel/test-runner-run-watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ test('test has ran');`,

let fixturePaths;

function refresh() {
async function refresh() {
const { rm, readdir } = await import('node:fs/promises');
console.log('refreshing', tmpdir.path);
await rm(tmpdir.path, { maxRetries: 3, recursive: true, force: true });

tmpdir.refresh();

fixturePaths = Object.keys(fixtureContent)
.reduce((acc, file) => ({ ...acc, [file]: tmpdir.resolve(file) }), {});
Object.entries(fixtureContent)
.forEach(([file, content]) => writeFileSync(fixturePaths[file], content));

console.log('contents of %s:', tmpdir.path, await readdir(tmpdir.path));
}

const runner = join(import.meta.dirname, '..', 'fixtures', 'test-runner-watch.mjs');
Expand Down

0 comments on commit 383ec7f

Please sign in to comment.