summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/uninstall-package.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-11-20 11:08:52 -0800
committerisaacs <i@izs.me>2013-11-20 11:08:52 -0800
commitc1452f4c6fac17dd8ab974372daee05cd5cdbdec (patch)
tree12d57003bc0f73e1be3893beaebe82ef6a4a83c3 /deps/npm/test/tap/uninstall-package.js
parent88dc1fcb62f40c3c906802dcaa8a8e9dfef2a264 (diff)
downloadandroid-node-v8-c1452f4c6fac17dd8ab974372daee05cd5cdbdec.tar.gz
android-node-v8-c1452f4c6fac17dd8ab974372daee05cd5cdbdec.tar.bz2
android-node-v8-c1452f4c6fac17dd8ab974372daee05cd5cdbdec.zip
npm: Upgrade to v1.3.15
Diffstat (limited to 'deps/npm/test/tap/uninstall-package.js')
-rw-r--r--deps/npm/test/tap/uninstall-package.js35
1 files changed, 26 insertions, 9 deletions
diff --git a/deps/npm/test/tap/uninstall-package.js b/deps/npm/test/tap/uninstall-package.js
index d6bfa0d8fc..0682701250 100644
--- a/deps/npm/test/tap/uninstall-package.js
+++ b/deps/npm/test/tap/uninstall-package.js
@@ -1,24 +1,41 @@
var test = require("tap").test
, npm = require("../../")
+ , rimraf = require("rimraf")
+ , mr = require("npm-registry-mock")
+ , common = require("../common-tap.js")
+ , pkg = __dirname + "/uninstall-package"
test("returns a list of removed items", function (t) {
t.plan(1)
-
- setup(function () {
- npm.install(".", function (err) {
- if (err) return t.fail(err)
- npm.uninstall("once", "ini", "lala", function (err, d) {
+ mr(common.port, function (s) {
+ setup(function () {
+ npm.install(".", function (err) {
if (err) return t.fail(err)
- t.same(d.sort(), ["once", "ini"].sort())
- t.end()
+ npm.uninstall("underscore", "request", "lala", function (err, d) {
+ if (err) return t.fail(err)
+ t.same(d.sort(), ["underscore", "request"].sort())
+ s.close()
+ t.end()
+ })
})
})
})
})
+test("cleanup", function (t) {
+ cleanup()
+ t.end()
+})
+
function setup (cb) {
- process.chdir(__dirname + "/uninstall-package")
- npm.load(function () {
+ cleanup()
+ process.chdir(pkg)
+ npm.load({cache: pkg + "/cache", registry: common.registry}, function () {
cb()
})
}
+
+function cleanup () {
+ rimraf.sync(pkg + "/node_modules")
+ rimraf.sync(pkg + "/cache")
+}