Skip to content

Commit f1b26be

Browse files
TrottMylesBorins
authored andcommitted
test: remove common.tmpDirName
`common.tmpDirName` is used in only one test and can be replaced with `path.basename(common.tmpDir)`. PR-URL: #17266 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent cc91a00 commit f1b26be

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

test/common/README.md

-5
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,6 @@ Synchronous version of `spawnPwd`.
376376

377377
The realpath of the 'tmp' directory.
378378

379-
### tmpDirName
380-
* return [&lt;String>]
381-
382-
Name of the temp directory used by tests.
383-
384379
## Countdown Module
385380

386381
The `Countdown` module provides a simple countdown mechanism for tests that

test/common/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ exports.fixturesDir = fixturesDir;
4040

4141
// Using a `.` prefixed name, which is the convention for "hidden" on POSIX,
4242
// gets tools to ignore it by default or by simple rules, especially eslint.
43-
exports.tmpDirName = '.tmp';
43+
let tmpDirName = '.tmp';
4444
// PORT should match the definition in test/testpy/__init__.py.
4545
exports.PORT = +process.env.NODE_COMMON_PORT || 12346;
4646
exports.isWindows = process.platform === 'win32';
@@ -165,9 +165,9 @@ exports.refreshTmpDir = function() {
165165

166166
if (process.env.TEST_THREAD_ID) {
167167
exports.PORT += process.env.TEST_THREAD_ID * 100;
168-
exports.tmpDirName += `.${process.env.TEST_THREAD_ID}`;
168+
tmpDirName += `.${process.env.TEST_THREAD_ID}`;
169169
}
170-
exports.tmpDir = path.join(testRoot, exports.tmpDirName);
170+
exports.tmpDir = path.join(testRoot, tmpDirName);
171171

172172
let opensslCli = null;
173173
let inFreeBSDJail = null;

test/parallel/test-fs-realpath.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function test_simple_relative_symlink(realpath, realpathSync, callback) {
111111
const entry = `${tmpDir}/symlink`;
112112
const expected = `${tmpDir}/cycles/root.js`;
113113
[
114-
[entry, `../${common.tmpDirName}/cycles/root.js`]
114+
[entry, `../${path.basename(tmpDir)}/cycles/root.js`]
115115
].forEach(function(t) {
116116
try { fs.unlinkSync(t[0]); } catch (e) {}
117117
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');

0 commit comments

Comments
 (0)