0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/parallel/test-module-globalpaths-nodepath.js
Sakthipriyan Vairamani d5ab92bcc1 test: use common.isWindows consistently
In the tests, we use "process.platform === 'win32'" in some places.
This patch replaces them with the "common.isWindows" for consistency.

PR-URL: https://github.com/nodejs/io.js/pull/2269
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-31 00:29:36 +05:30

27 lines
726 B
JavaScript

'use strict';
var common = require('../common');
var assert = require('assert');
var module = require('module');
var partA, partB;
var partC = '';
if (common.isWindows) {
partA = 'C:\\Users\\Rocko Artischocko\\AppData\\Roaming\\npm';
partB = 'C:\\Program Files (x86)\\nodejs\\';
process.env['NODE_PATH'] = partA + ';' + partB + ';' + partC;
} else {
partA = '/usr/test/lib/node_modules';
partB = '/usr/test/lib/node';
process.env['NODE_PATH'] = partA + ':' + partB + ':' + partC;
}
module._initPaths();
assert.ok(module.globalPaths.indexOf(partA) !== -1);
assert.ok(module.globalPaths.indexOf(partB) !== -1);
assert.ok(module.globalPaths.indexOf(partC) === -1);
assert.ok(Array.isArray(module.globalPaths));