diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-11-04 15:08:12 -0800 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-11-05 10:35:43 -0800 |
commit | 28ae70ebad8debd8aa7b521a693aa3de89ad84d6 (patch) | |
tree | c5cd9142bbefe8f84c9555e07cafd677530cb7ef /deps/npm/test/tap/install-scoped-link.js | |
parent | 272aa589af50566a20a491910d4dc40bb3692102 (diff) | |
download | android-node-v8-28ae70ebad8debd8aa7b521a693aa3de89ad84d6.tar.gz android-node-v8-28ae70ebad8debd8aa7b521a693aa3de89ad84d6.tar.bz2 android-node-v8-28ae70ebad8debd8aa7b521a693aa3de89ad84d6.zip |
npm: Upgrade to v2.1.6
Diffstat (limited to 'deps/npm/test/tap/install-scoped-link.js')
-rw-r--r-- | deps/npm/test/tap/install-scoped-link.js | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/deps/npm/test/tap/install-scoped-link.js b/deps/npm/test/tap/install-scoped-link.js index c411b664d7..b1e6ca0b22 100644 --- a/deps/npm/test/tap/install-scoped-link.js +++ b/deps/npm/test/tap/install-scoped-link.js @@ -1,18 +1,18 @@ -var exec = require("child_process").exec +var common = require("../common-tap.js") var existsSync = require("fs").existsSync var join = require("path").join -// var resolve = require("path").resolve +var exec = require("child_process").exec var test = require("tap").test var rimraf = require("rimraf") var mkdirp = require("mkdirp") -var npm = require("../../") - var pkg = join(__dirname, "install-scoped") var work = join(__dirname, "install-scoped-TEST") var modules = join(work, "node_modules") +var EXEC_OPTS = {} + test("setup", function (t) { mkdirp.sync(modules) process.chdir(work) @@ -21,31 +21,30 @@ test("setup", function (t) { }) test("installing package with links", function (t) { - npm.load(function() { - npm.commands.install([pkg], function (err) { - t.ifError(err, "install ran to completion without error") - - t.ok( - existsSync(join(modules, "@scoped", "package", "package.json")), - "package installed" - ) - t.ok(existsSync(join(modules, ".bin")), "binary link directory exists") - - var hello = join(modules, ".bin", "hello") - t.ok(existsSync(hello), "binary link exists") - - exec("node " + hello, function (err, stdout, stderr) { - t.ifError(err, "command ran fine") - t.notOk(stderr, "got no error output back") - t.equal(stdout, "hello blrbld\n", "output was as expected") - - t.end() - }) + common.npm(["install", pkg], EXEC_OPTS, function (err, code) { + t.ifError(err, "install ran to completion without error") + t.notOk(code, "npm install exited with code 0") + + t.ok( + existsSync(join(modules, "@scoped", "package", "package.json")), + "package installed" + ) + t.ok(existsSync(join(modules, ".bin")), "binary link directory exists") + + var hello = join(modules, ".bin", "hello") + t.ok(existsSync(hello), "binary link exists") + + exec("node " + hello, function (err, stdout, stderr) { + t.ifError(err, "command ran fine") + t.notOk(stderr, "got no error output back") + t.equal(stdout, "hello blrbld\n", "output was as expected") + + t.end() }) }) }) -test("cleanup", function(t) { +test("cleanup", function (t) { process.chdir(__dirname) rimraf.sync(work) t.end() |