Comparing version 0.4.0 to 0.4.1
@@ -91,2 +91,4 @@ var core = require('./core'); | ||
if (m) return cb(null, m, pkg); | ||
if (!pkg) return loadAsFile(path.join(x, '/index'), pkg, cb); | ||
var dir = path.resolve(x, pkg.main); | ||
@@ -93,0 +95,0 @@ loadAsDirectory(dir, pkg, function (err, n, pkg) { |
{ | ||
"name" : "resolve", | ||
"description" : "resolve like require.resolve() on behalf of files asynchronously and synchronously", | ||
"version" : "0.4.0", | ||
"version" : "0.4.1", | ||
"repository" : { | ||
@@ -6,0 +6,0 @@ "type" : "git", |
@@ -158,1 +158,14 @@ var test = require('tap').test; | ||
}); | ||
test('incorrect main', function (t) { | ||
var resolverDir = __dirname + '/resolver'; | ||
var dir = resolverDir + '/incorrect_main'; | ||
t.equal( | ||
resolve.sync('./incorrect_main', { basedir : resolverDir }), | ||
dir + '/index.js' | ||
) | ||
t.end() | ||
}); |
@@ -207,1 +207,13 @@ var test = require('tap').test; | ||
}); | ||
test('incorrect main', function (t) { | ||
t.plan(1) | ||
var resolverDir = __dirname + '/resolver'; | ||
var dir = resolverDir + '/incorrect_main'; | ||
resolve('./incorrect_main', { basedir : resolverDir }, function (err, res, pkg) { | ||
if (err) t.fail(err); | ||
t.equal(res, dir + '/index.js'); | ||
}); | ||
}); |
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
30687
33
805