From 383ec7f5688f3f5118f2c41b7fe9c0768a839089 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 25 Jul 2024 10:03:44 -0400 Subject: [PATCH] ugh --- test/parallel/test-runner-run-watch.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-runner-run-watch.mjs b/test/parallel/test-runner-run-watch.mjs index 0445637bb6123c..faf0810ca9ad20 100644 --- a/test/parallel/test-runner-run-watch.mjs +++ b/test/parallel/test-runner-run-watch.mjs @@ -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');