diff options
Diffstat (limited to 'cli/tests/node_compat/test/common/tmpdir.js')
-rw-r--r-- | cli/tests/node_compat/test/common/tmpdir.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cli/tests/node_compat/test/common/tmpdir.js b/cli/tests/node_compat/test/common/tmpdir.js index d3ce98e45..dbc945c13 100644 --- a/cli/tests/node_compat/test/common/tmpdir.js +++ b/cli/tests/node_compat/test/common/tmpdir.js @@ -2,14 +2,14 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 16.13.0 +// Taken from Node 18.12.1 // This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually 'use strict'; const fs = require('fs'); const path = require('path'); -// const { isMainThread } = require('worker_threads'); +const { isMainThread } = require('worker_threads'); function rmSync(pathname) { fs.rmSync(pathname, { maxRetries: 3, recursive: true, force: true }); @@ -26,8 +26,8 @@ const tmpPath = path.join(testRoot, tmpdirName); let firstRefresh = true; function refresh() { - rmSync(this.path); - fs.mkdirSync(this.path); + rmSync(tmpPath); + fs.mkdirSync(tmpPath); if (firstRefresh) { firstRefresh = false; @@ -39,9 +39,8 @@ function refresh() { function onexit() { // Change directory to avoid possible EBUSY - // TODO(f3n67u): uncomment when `worker_thread.isMainThread` implemented - // if (isMainThread) - // process.chdir(testRoot); + if (isMainThread) + process.chdir(testRoot); try { rmSync(tmpPath); |