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 <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
pull/30997/head
Richard Lau 2019-12-16 16:25:31 -05:00
parent eaf59754be
commit e23aebc684
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C
1 changed files with 2 additions and 3 deletions

View File

@ -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');