diff options
author | Rich Trott <rtrott@gmail.com> | 2017-12-24 22:38:11 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-01-31 22:11:07 -0800 |
commit | bf6ce47259ebfe9f6349c223cc1735726aee062d (patch) | |
tree | 2f40f8e9618a253862cf1f0953992c8c16b56772 /test/parallel/test-fs-write.js | |
parent | 6035beea93e16f6d923201a33a541f6d724f00d6 (diff) | |
download | node-new-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.gz |
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.js')
-rw-r--r-- | test/parallel/test-fs-write.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index 911d6e696b..a3c8814bc3 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -25,17 +25,19 @@ const common = require('../common'); const assert = require('assert'); const path = require('path'); const fs = require('fs'); -const fn = path.join(common.tmpDir, 'write.txt'); -const fn2 = path.join(common.tmpDir, 'write2.txt'); -const fn3 = path.join(common.tmpDir, 'write3.txt'); +const tmpdir = require('../common/tmpdir'); + +tmpdir.refresh(); + +const fn = path.join(tmpdir.path, 'write.txt'); +const fn2 = path.join(tmpdir.path, 'write2.txt'); +const fn3 = path.join(tmpdir.path, 'write3.txt'); const expected = 'ümlaut.'; const constants = fs.constants; /* eslint-disable no-undef */ common.allowGlobals(externalizeString, isOneByteString, x); -common.refreshTmpDir(); - { const expected = 'ümlaut eins'; // Must be a unique string. externalizeString(expected); @@ -75,6 +77,7 @@ common.refreshTmpDir(); fs.closeSync(fd); assert.strictEqual(expected, fs.readFileSync(fn, 'utf8')); } +/* eslint-enable no-undef */ fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) { assert.ifError(err); |