Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
updated to use common.npm() and got rid of console pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismeyersfsu authored and othiym23 committed Oct 9, 2014
1 parent 97f861c commit d01b3de
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/tap/git-cache-locking.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
var test = require("tap").test
, common = require("../common-tap")
, path = require("path")
, rimraf = require("rimraf")
, mkdirp = require("mkdirp")
, spawn = require("child_process").spawn
, npm = require.resolve("../../bin/npm-cli.js")
, node = process.execPath
, pkg = path.resolve(__dirname, "git-cache-locking")
, tmp = path.join(pkg, "tmp")
, cache = path.join(pkg, "cache")


test("setup", function (t) {
rimraf.sync(pkg)
mkdirp.sync(pkg)
mkdirp.sync(cache)
mkdirp.sync(tmp)
mkdirp.sync(path.resolve(pkg, "node_modules"))
t.end()
})
Expand All @@ -26,7 +21,10 @@ test("git-cache-locking: install a git dependency", function (t) {

// package c depends on a.git#master and b.git#master
// package b depends on a.git#master
var child = spawn(node, [npm, "install", "git://github.com/nigelzor/npm-4503-c.git"], {
common.npm([
"install",
"git://github.com/nigelzor/npm-4503-c.git"
], {
cwd: pkg,
env: {
"npm_config_cache": cache,
Expand All @@ -36,11 +34,9 @@ test("git-cache-locking: install a git dependency", function (t) {
HOME: process.env.HOME,
Path: process.env.PATH,
PATH: process.env.PATH
},
stdio: "inherit"
})

child.on("close", function (code) {
}
}, function (err, code) {
t.ifErr(err, "npm install finished without error")
t.equal(0, code, "npm install should succeed")
t.end()
})
Expand Down

0 comments on commit d01b3de

Please sign in to comment.