main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
646 bytes
|
Rev | Line | |
---|
[d565449] | 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.