• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../../../common');
3const assert = require('assert');
4const path = require('path');
5
6// By default, resolving 'dep' should return
7// fixturesDir/resolve-paths/default/node_modules/dep/index.js. By setting
8// the path to fixturesDir/resolve-paths/default, the 'default' directory
9// structure should be ignored.
10
11assert.strictEqual(
12  require.resolve('dep'),
13  path.join(__dirname, 'node_modules', 'dep', 'index.js')
14);
15
16const paths = [path.resolve(__dirname, '..', 'defined')];
17
18assert.strictEqual(
19  require.resolve('dep', { paths }),
20  path.join(paths[0], 'node_modules', 'dep', 'index.js')
21);
22