From e23aebc684a45f725811211f9740bcee3bcdbe26 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 c4d9ff4cde2c95..76e016217b3ef8 100644 --- a/test/es-module/test-esm-windows.js +++ b/test/es-module/test-esm-windows.js @@ -14,9 +14,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');