mirror of
https://github.com/actions/labeler.git
synced 2025-12-18 16:16:48 +00:00
build
This commit is contained in:
33
node_modules/resolve/test/resolver_sync.js
generated
vendored
33
node_modules/resolve/test/resolver_sync.js
generated
vendored
@@ -172,6 +172,21 @@ test('other path', function (t) {
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('path iterator', function (t) {
|
||||
var resolverDir = path.join(__dirname, 'resolver');
|
||||
|
||||
var exactIterator = function (x, start, getPackageCandidates, opts) {
|
||||
return [path.join(resolverDir, x)];
|
||||
};
|
||||
|
||||
t.equal(
|
||||
resolve.sync('baz', { packageIterator: exactIterator }),
|
||||
path.join(resolverDir, 'baz/quux.js')
|
||||
);
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('incorrect main', function (t) {
|
||||
var resolverDir = path.join(__dirname, 'resolver');
|
||||
var dir = path.join(resolverDir, 'incorrect_main');
|
||||
@@ -223,6 +238,20 @@ test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) {
|
||||
var dir = path.join(__dirname, 'resolver');
|
||||
|
||||
t.equal(
|
||||
resolve.sync('./', { basedir: path.join(dir, 'same_names/foo') }),
|
||||
path.join(dir, 'same_names/foo/index.js')
|
||||
);
|
||||
t.equal(
|
||||
resolve.sync('.', { basedir: path.join(dir, 'same_names/foo') }),
|
||||
path.join(dir, 'same_names/foo/index.js')
|
||||
);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('sync: #121 - treating an existing file as a dir when no basedir', function (t) {
|
||||
var testFile = path.basename(__filename);
|
||||
|
||||
@@ -318,8 +347,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