source: trip-planner-front/node_modules/resolve/test/precedence.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 646 bytes
Line 
1var path = require('path');
2var test = require('tape');
3var resolve = require('../');
4
5test('precedence', function (t) {
6 t.plan(3);
7 var dir = path.join(__dirname, 'precedence/aaa');
8
9 resolve('./', { basedir: dir }, function (err, res, pkg) {
10 t.ifError(err);
11 t.equal(res, path.join(dir, 'index.js'));
12 t.equal(pkg.name, 'resolve');
13 });
14});
15
16test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string
17 t.plan(1);
18 var dir = path.join(__dirname, 'precedence/bbb');
19
20 resolve('./', { basedir: dir }, function (err, res, pkg) {
21 t.ok(err);
22 });
23});
Note: See TracBrowser for help on using the repository browser.