node/deps/npm/test/tap/git-cache-locking.js
isaacs 75bc11cf12 npm: upgrade to 1.4.7
* isaacs, Robert Kowalski, Benjamin Coe: Test Improvements
* isaacs doc: Add canonical url
* isaacs view: handle unpublished packages properly
* Raynos (Jake Verbaten) do not log if silent
* Julian Gruber fix no such property error
* isaacs npmconf@0.1.14
* Thorsten Lorenz adding save-prefix configuration option
* isaacs npm-registry-client@0.4.7
* isaacs cache: treat missing versions as a 404
* isaacs cache: Save shasum, write resolved/etc data to cache
* isaacs cache: Always fetch root doc
* isaacs cache: don't repack unnecessarily from tmp
* Andrey Kislyuk Don't crash if shrinkwrap-dependencies were not passed in pkginfo
* Robert Kowalski fix link in faq
* Jean Lauliac Add a peerDependencies section in package.json doc
* isaacs read-installed@2.0.2
2014-04-15 15:31:36 -07:00

53 lines
1.3 KiB
JavaScript

var test = require("tap").test
, 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()
})
test("git-cache-locking: install a git dependency", function (t) {
// disable git integration tests on Travis.
if (process.env.TRAVIS) return t.end()
// 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"], {
cwd: pkg,
env: {
npm_config_cache: cache,
npm_config_tmp: tmp,
npm_config_prefix: pkg,
npm_config_global: "false",
HOME: process.env.HOME,
Path: process.env.PATH,
PATH: process.env.PATH
},
stdio: "inherit"
})
child.on("close", function (code) {
t.equal(0, code, "npm install should succeed")
t.end()
})
})
test('cleanup', function(t) {
rimraf.sync(pkg)
t.end()
})