2013-05-17 20:20:20 +02:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
|
|
|
|
|
|
|
var module = require('module');
|
|
|
|
|
|
|
|
var isWindows = process.platform === 'win32';
|
|
|
|
|
|
|
|
var file, delimiter, paths;
|
|
|
|
|
|
|
|
if (isWindows) {
|
2014-12-06 15:42:24 +01:00
|
|
|
file = 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo';
|
2013-05-17 20:20:20 +02:00
|
|
|
delimiter = '\\'
|
|
|
|
} else {
|
|
|
|
file = '/usr/test/lib/node_modules/npm/foo';
|
|
|
|
delimiter = '/'
|
|
|
|
}
|
|
|
|
|
|
|
|
paths = module._nodeModulePaths(file);
|
|
|
|
|
|
|
|
assert.ok(paths.indexOf(file + delimiter + 'node_modules') !== -1);
|
2014-12-06 15:42:24 +01:00
|
|
|
assert.ok(Array.isArray(paths));
|