v3 new release (#84)

swap to graphql
This commit is contained in:
github-actions[bot]
2022-07-11 13:48:02 -04:00
committed by GitHub
parent 20d2b4f98d
commit e4f3964f67
1492 changed files with 63799 additions and 63001 deletions

View File

@ -290,6 +290,55 @@ test('incorrect main', function (t) {
});
});
test('missing index', function (t) {
t.plan(2);
var resolverDir = path.join(__dirname, 'resolver');
resolve('./missing_index', { basedir: resolverDir }, function (err, res, pkg) {
t.ok(err instanceof Error);
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
});
});
test('missing main', function (t) {
t.plan(1);
var resolverDir = path.join(__dirname, 'resolver');
resolve('./missing_main', { basedir: resolverDir }, function (err, res, pkg) {
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
});
});
test('null main', function (t) {
t.plan(1);
var resolverDir = path.join(__dirname, 'resolver');
resolve('./null_main', { basedir: resolverDir }, function (err, res, pkg) {
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
});
});
test('main: false', function (t) {
t.plan(2);
var basedir = path.join(__dirname, 'resolver');
var dir = path.join(basedir, 'false_main');
resolve('./false_main', { basedir: basedir }, function (err, res, pkg) {
if (err) t.fail(err);
t.equal(
res,
path.join(dir, 'index.js'),
'`"main": false`: resolves to `index.js`'
);
t.deepEqual(pkg, {
name: 'false_main',
main: false
});
});
});
test('without basedir', function (t) {
t.plan(1);