mirror of
https://github.com/actions/labeler.git
synced 2025-12-18 16:16:48 +00:00
build
This commit is contained in:
36
node_modules/resolve/test/resolver.js
generated
vendored
36
node_modules/resolve/test/resolver.js
generated
vendored
@@ -256,6 +256,22 @@ test('other path', function (t) {
|
||||
});
|
||||
});
|
||||
|
||||
test('path iterator', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var resolverDir = path.join(__dirname, 'resolver');
|
||||
|
||||
var exactIterator = function (x, start, getPackageCandidates, opts) {
|
||||
return [path.join(resolverDir, x)];
|
||||
};
|
||||
|
||||
resolve('baz', { packageIterator: exactIterator }, function (err, res, pkg) {
|
||||
if (err) t.fail(err);
|
||||
t.equal(res, path.join(resolverDir, 'baz/quux.js'));
|
||||
t.equal(pkg && pkg.name, 'baz');
|
||||
});
|
||||
});
|
||||
|
||||
test('incorrect main', function (t) {
|
||||
t.plan(1);
|
||||
|
||||
@@ -299,6 +315,22 @@ test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is
|
||||
});
|
||||
});
|
||||
|
||||
test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var dir = path.join(__dirname, 'resolver');
|
||||
|
||||
resolve('./', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) {
|
||||
if (err) t.fail(err);
|
||||
t.equal(res, path.join(dir, 'same_names/foo/index.js'));
|
||||
});
|
||||
|
||||
resolve('.', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) {
|
||||
if (err) t.fail(err);
|
||||
t.equal(res, path.join(dir, 'same_names/foo/index.js'));
|
||||
});
|
||||
});
|
||||
|
||||
test('async: #121 - treating an existing file as a dir when no basedir', function (t) {
|
||||
var testFile = path.basename(__filename);
|
||||
|
||||
@@ -402,8 +434,8 @@ test('browser field in package.json', function (t) {
|
||||
basedir: dir,
|
||||
packageFilter: function packageFilter(pkg) {
|
||||
if (pkg.browser) {
|
||||
pkg.main = pkg.browser;
|
||||
delete pkg.browser;
|
||||
pkg.main = pkg.browser; // eslint-disable-line no-param-reassign
|
||||
delete pkg.browser; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
return pkg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user