0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-module-nodemodulepaths.js

21 lines
465 B
JavaScript
Raw Normal View History

'use strict';
var common = require('../common');
var assert = require('assert');
var module = require('module');
var file, delimiter, paths;
if (common.isWindows) {
file = 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo';
delimiter = '\\';
} else {
file = '/usr/test/lib/node_modules/npm/foo';
delimiter = '/';
}
paths = module._nodeModulePaths(file);
assert.ok(paths.indexOf(file + delimiter + 'node_modules') !== -1);
assert.ok(Array.isArray(paths));