From 56188fe5b27e5d497ebdb41ebf7f322f6e3ddf62 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 16 Dec 2019 16:25:31 -0500 Subject: [PATCH] test: use tmpdir.refresh() in test-esm-windows.js Use `tmpdir.refresh()` in `test/es-module/test-esm-windows.js` so that the temporary directory is cleaned before use and when the test exits. PR-URL: https://github.com/nodejs/node/pull/30997 Reviewed-By: Denys Otrishko Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/es-module/test-esm-windows.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/es-module/test-esm-windows.js b/test/es-module/test-esm-windows.js index 64ba1249a76c06..44af65d6a4e031 100644 --- a/test/es-module/test-esm-windows.js +++ b/test/es-module/test-esm-windows.js @@ -15,9 +15,8 @@ const imp = (file) => { }; (async () => { - const tmp = tmpdir.path; - await fs.mkdir(tmp).catch(() => {}); - const rel = (file) => path.join(tmp, file); + tmpdir.refresh(); + const rel = (file) => path.join(tmpdir.path, file); { // Load a single script const file = rel('con.mjs');