Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
28 lines
766 B
JavaScript
28 lines
766 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var module = require('module');
|
|
|
|
var isWindows = process.platform === 'win32';
|
|
|
|
var partA, partB;
|
|
var partC = '';
|
|
|
|
if (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));
|