diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-09-24 14:41:07 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-09-24 17:15:10 -0700 |
commit | 9fad8958df671c0e894506ef59b4c781c3dfb349 (patch) | |
tree | 4db7643b40c4ffd726fb27fb4aa276d420b3bfd8 /deps/npm/test/tap/optional-metadep-rollback-collision.js | |
parent | b26dd4e5ab9192bad72b9dc61fa4ad2d8f215da2 (diff) | |
download | android-node-v8-9fad8958df671c0e894506ef59b4c781c3dfb349.tar.gz android-node-v8-9fad8958df671c0e894506ef59b4c781c3dfb349.tar.bz2 android-node-v8-9fad8958df671c0e894506ef59b4c781c3dfb349.zip |
deps: upgrade npm to 2.0.0
Diffstat (limited to 'deps/npm/test/tap/optional-metadep-rollback-collision.js')
-rw-r--r-- | deps/npm/test/tap/optional-metadep-rollback-collision.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision.js b/deps/npm/test/tap/optional-metadep-rollback-collision.js new file mode 100644 index 0000000000..29db793bc4 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision.js @@ -0,0 +1,56 @@ +var test = require("tap").test +var rimraf = require("rimraf") +var common = require("../common-tap.js") +var path = require("path") +var fs = require("fs") + +var pkg = path.resolve(__dirname, "optional-metadep-rollback-collision") +var nm = path.resolve(pkg, "node_modules") +var cache = path.resolve(pkg, "cache") +var pidfile = path.resolve(pkg, "child.pid") + +test("setup", function (t) { + cleanup() + t.end() +}) + +test("go go test racer", function (t) { + common.npm(["install", "--prefix=" + pkg, "--fetch-retries=0", "--cache=" + cache], { + cwd: pkg, + env: { + PATH: process.env.PATH, + Path: process.env.Path, + "npm_config_loglevel": "silent" + }, + stdio: [ 0, "pipe", 2 ] + }, function (er, code, sout) { + if (er) throw er + t.equal(code, 0) + t.equal(sout, "ok\nok\n") + t.notOk(/not ok/.test(sout), "should not contain the string 'not ok'") + t.end() + }) +}) + +test("verify results", function (t) { + t.throws(function () { + fs.statSync(nm) + }) + t.end() +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) + +function cleanup () { + try { + var pid = +fs.readFileSync(pidfile) + process.kill(pid, "SIGKILL") + } catch (er) {} + + rimraf.sync(cache) + rimraf.sync(nm) + rimraf.sync(pidfile) +} |