]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-locking.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / test / tap / git-cache-locking.js
1 var test = require('tap').test
2 var common = require('../common-tap')
3 var path = require('path')
4 var rimraf = require('rimraf')
5 var mkdirp = require('mkdirp')
6 var pkg = path.resolve(__dirname, 'git-cache-locking')
7 var tmp = path.join(pkg, 'tmp')
8 var cache = path.join(pkg, 'cache')
9
10 test('setup', function (t) {
11   rimraf.sync(pkg)
12   mkdirp.sync(path.resolve(pkg, 'node_modules'))
13   t.end()
14 })
15
16 test('git-cache-locking: install a git dependency', function (t) {
17   // disable git integration tests on Travis.
18   if (process.env.TRAVIS) return t.end()
19
20   // package c depends on a.git#master and b.git#master
21   // package b depends on a.git#master
22   common.npm([
23     'install',
24     'git://github.com/nigelzor/npm-4503-c.git'
25   ], {
26     cwd: pkg,
27     env: {
28       npm_config_cache: cache,
29       npm_config_tmp: tmp,
30       npm_config_prefix: pkg,
31       npm_config_global: 'false',
32       HOME: process.env.HOME,
33       Path: process.env.PATH,
34       PATH: process.env.PATH
35     }
36   }, function (err, code, stdout, stderr) {
37     t.ifErr(err, 'npm install finished without error')
38     t.equal(0, code, 'npm install should succeed')
39     t.end()
40   })
41 })
42
43 test('cleanup', function (t) {
44   rimraf.sync(pkg)
45   t.end()
46 })