test: remove common.tmpDirName

`common.tmpDirName` is used in only one test and can be replaced with
`path.basename(common.tmpDir)`.

PR-URL: https://github.com/nodejs/node/pull/17266
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
Rich Trott authored and Myles Borins committed 2017-12-12 03:27:49 -05:00
1 parent cc91a00af6
commit f1b26be684
3 files changed
+4 -9

No files matched your search

-5
View File
@@ -376,11 +376,6 @@ Synchronous version of `spawnPwd`.
The realpath of the 'tmp' directory.
### tmpDirName
* return [&lt;String>]
Name of the temp directory used by tests.
## Countdown Module
The `Countdown` module provides a simple countdown mechanism for tests that
+3 -3
View File
@@ -40,7 +40,7 @@ exports.fixturesDir = fixturesDir;
// Using a `.` prefixed name, which is the convention for "hidden" on POSIX,
// gets tools to ignore it by default or by simple rules, especially eslint.
exports.tmpDirName = '.tmp';
let tmpDirName = '.tmp';
// PORT should match the definition in test/testpy/__init__.py.
exports.PORT = +process.env.NODE_COMMON_PORT || 12346;
exports.isWindows = process.platform === 'win32';
@@ -165,9 +165,9 @@ exports.refreshTmpDir = function() {
if (process.env.TEST_THREAD_ID) {
exports.PORT += process.env.TEST_THREAD_ID * 100;
exports.tmpDirName += `.${process.env.TEST_THREAD_ID}`;
tmpDirName += `.${process.env.TEST_THREAD_ID}`;
}
exports.tmpDir = path.join(testRoot, exports.tmpDirName);
exports.tmpDir = path.join(testRoot, tmpDirName);
let opensslCli = null;
let inFreeBSDJail = null;
+1 -1
View File
@@ -111,7 +111,7 @@ function test_simple_relative_symlink(realpath, realpathSync, callback) {
const entry = `${tmpDir}/symlink`;
const expected = `${tmpDir}/cycles/root.js`;
[
[entry, `../${common.tmpDirName}/cycles/root.js`]
[entry, `../${path.basename(tmpDir)}/cycles/root.js`]
].forEach(function(t) {
try { fs.unlinkSync(t[0]); } catch (e) {}
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');