diff options
Diffstat (limited to 'deps/npm/test/tap/bundled-dependencies-no-pkgjson.js')
-rw-r--r-- | deps/npm/test/tap/bundled-dependencies-no-pkgjson.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/deps/npm/test/tap/bundled-dependencies-no-pkgjson.js b/deps/npm/test/tap/bundled-dependencies-no-pkgjson.js index 44eb47a03a..a7056408a9 100644 --- a/deps/npm/test/tap/bundled-dependencies-no-pkgjson.js +++ b/deps/npm/test/tap/bundled-dependencies-no-pkgjson.js @@ -19,23 +19,31 @@ var pkgJson = JSON.stringify({ 'a-bundled-dep' ] }, null, 2) + '\n' +var packed test('setup', function (t) { + rimraf.sync(dir) mkdirp.sync(path.join(dir, 'node_modules')) mkdirp.sync(dep) fs.writeFileSync(path.resolve(pkg, 'package.json'), pkgJson) fs.writeFileSync(path.resolve(dep, 'index.js'), '') - t.end() + common.npm(['pack', pkg], {cwd: dir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'packed ok') + packed = stdout.trim() + t.comment(stderr) + t.end() + }) }) test('proper error on bundled dep with no package.json', function (t) { - t.plan(3) - var npmArgs = ['install', './' + path.basename(pkg)] + t.plan(2) + var npmArgs = ['install', packed] common.npm(npmArgs, { cwd: dir }, function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notEqual(code, 0) + if (err) throw err + t.notEqual(code, 0, 'npm ended in error') t.like(stderr, /ENOENT/, 'ENOENT should be in stderr') t.end() }) |