From 21c1b8467ec6a2a5574f3ecc3fa38f4158525ba3 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sat, 16 Jul 2016 04:17:36 +0300 Subject: [PATCH] test: decrease inconsistency in the common.js 1. `process.env['PROCESSOR_ARCHITEW6432']` -> `process.env.PROCESSOR_ARCHITEW6432`. 2. `path.dirname(__filename)` -> `__dirname`. 3. `path.resolve(__dirname)` -> `__dirname`. PR-URL: https://github.com/nodejs/node/pull/7758 Reviewed-By: Colin Ihrig Reviewed-By: Jeremiah Senkpiel Reviewed-By: Anna Henningsen Reviewed-By: Sakthipriyan Vairamani --- test/common.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common.js b/test/common.js index 668d98b108..3850bec06f 100644 --- a/test/common.js +++ b/test/common.js @@ -8,17 +8,17 @@ var child_process = require('child_process'); const stream = require('stream'); const util = require('util'); -const testRoot = path.resolve(process.env.NODE_TEST_DIR || - path.dirname(__filename)); +const testRoot = process.env.NODE_TEST_DIR ? + path.resolve(process.env.NODE_TEST_DIR) : __dirname; -exports.testDir = path.dirname(__filename); +exports.testDir = __dirname; exports.fixturesDir = path.join(exports.testDir, 'fixtures'); exports.libDir = path.join(exports.testDir, '../lib'); exports.tmpDirName = 'tmp'; exports.PORT = +process.env.NODE_COMMON_PORT || 12346; exports.isWindows = process.platform === 'win32'; exports.isWOW64 = exports.isWindows && - (process.env['PROCESSOR_ARCHITEW6432'] !== undefined); + (process.env.PROCESSOR_ARCHITEW6432 !== undefined); exports.isAix = process.platform === 'aix'; exports.isLinuxPPCBE = (process.platform === 'linux') && (process.arch === 'ppc64') &&