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