aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-write-file-invalid-path.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-12-24 22:38:11 -0800
committerRich Trott <rtrott@gmail.com>2018-01-31 22:11:07 -0800
commitbf6ce47259ebfe9f6349c223cc1735726aee062d (patch)
tree2f40f8e9618a253862cf1f0953992c8c16b56772 /test/parallel/test-fs-write-file-invalid-path.js
parent6035beea93e16f6d923201a33a541f6d724f00d6 (diff)
downloadandroid-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.gz
android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.bz2
android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.zip
test: move tmpdir to submodule of common
Move tmpdir functionality to its own module (common/tmpdir). PR-URL: https://github.com/nodejs/node/pull/17856 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-write-file-invalid-path.js')
-rw-r--r--test/parallel/test-fs-write-file-invalid-path.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/parallel/test-fs-write-file-invalid-path.js b/test/parallel/test-fs-write-file-invalid-path.js
index c45eaccf2b..a4c8ff5bf7 100644
--- a/test/parallel/test-fs-write-file-invalid-path.js
+++ b/test/parallel/test-fs-write-file-invalid-path.js
@@ -8,7 +8,8 @@ const path = require('path');
if (!common.isWindows)
common.skip('This test is for Windows only.');
-common.refreshTmpDir();
+const tmpdir = require('../common/tmpdir');
+tmpdir.refresh();
const DATA_VALUE = 'hello';
@@ -17,7 +18,7 @@ const DATA_VALUE = 'hello';
const RESERVED_CHARACTERS = '<>"|?*';
[...RESERVED_CHARACTERS].forEach((ch) => {
- const pathname = path.join(common.tmpDir, `somefile_${ch}`);
+ const pathname = path.join(tmpdir.path, `somefile_${ch}`);
assert.throws(
() => {
fs.writeFileSync(pathname, DATA_VALUE);
@@ -28,7 +29,7 @@ const RESERVED_CHARACTERS = '<>"|?*';
// Test for ':' (NTFS data streams).
// Refs: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540537.aspx
-const pathname = path.join(common.tmpDir, 'foo:bar');
+const pathname = path.join(tmpdir.path, 'foo:bar');
fs.writeFileSync(pathname, DATA_VALUE);
let content = '';