Comparing version 0.4.1 to 0.4.2
@@ -54,3 +54,3 @@ var core = require('./core'); | ||
(function load (exts) { | ||
if (exts.length === 0) return cb(null, undefined); | ||
if (exts.length === 0) return cb(null, undefined, pkg); | ||
var file = x + exts[0]; | ||
@@ -57,0 +57,0 @@ |
{ | ||
"name" : "resolve", | ||
"description" : "resolve like require.resolve() on behalf of files asynchronously and synchronously", | ||
"version" : "0.4.1", | ||
"version" : "0.4.2", | ||
"repository" : { | ||
@@ -6,0 +6,0 @@ "type" : "git", |
@@ -78,3 +78,3 @@ var test = require('tap').test; | ||
test('biz', function (t) { | ||
t.plan(12); | ||
t.plan(24); | ||
var dir = __dirname + '/resolver/biz/node_modules'; | ||
@@ -94,2 +94,14 @@ | ||
resolve('./garply', { basedir : dir }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/garply/lib/index.js'); | ||
t.equal(pkg.main, './lib'); | ||
}); | ||
resolve('./garply', { basedir : dir, package: { main: 'biz' } }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/garply/lib/index.js'); | ||
t.equal(pkg.main, './lib'); | ||
}); | ||
resolve('tiv', { basedir : dir + '/grux' }, function (err, res, pkg) { | ||
@@ -107,2 +119,14 @@ if (err) t.fail(err); | ||
resolve('tiv', { basedir : dir + '/garply' }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/tiv/index.js'); | ||
t.equal(pkg, undefined); | ||
}); | ||
resolve('tiv', { basedir : dir + '/garply', package: { main: './lib' } }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/tiv/index.js'); | ||
t.equal(pkg, undefined); | ||
}); | ||
resolve('grux', { basedir : dir + '/tiv' }, function (err, res, pkg) { | ||
@@ -119,2 +143,14 @@ if (err) t.fail(err); | ||
}); | ||
resolve('garply', { basedir : dir + '/tiv' }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/garply/lib/index.js'); | ||
t.equal(pkg.main, './lib'); | ||
}); | ||
resolve('garply', { basedir : dir + '/tiv', package: { main: 'tiv' } }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/garply/lib/index.js'); | ||
t.equal(pkg.main, './lib'); | ||
}); | ||
}); | ||
@@ -121,0 +157,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32044
35
836