11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_cirequire('../../../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst path = require('path'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci// By default, resolving 'dep' should return 71cb0ef41Sopenharmony_ci// fixturesDir/resolve-paths/default/node_modules/dep/index.js. By setting 81cb0ef41Sopenharmony_ci// the path to fixturesDir/resolve-paths/default, the 'default' directory 91cb0ef41Sopenharmony_ci// structure should be ignored. 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciassert.strictEqual( 121cb0ef41Sopenharmony_ci require.resolve('dep'), 131cb0ef41Sopenharmony_ci path.join(__dirname, 'node_modules', 'dep', 'index.js') 141cb0ef41Sopenharmony_ci); 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ciconst paths = [path.resolve(__dirname, '..', 'defined')]; 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ciassert.strictEqual( 191cb0ef41Sopenharmony_ci require.resolve('dep', { paths }), 201cb0ef41Sopenharmony_ci path.join(paths[0], 'node_modules', 'dep', 'index.js') 211cb0ef41Sopenharmony_ci); 22