Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
646 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var path = require('path');
|
---|
| 2 | var test = require('tape');
|
---|
| 3 | var resolve = require('../');
|
---|
| 4 |
|
---|
| 5 | test('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 |
|
---|
| 16 | test('./ 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.