diff options
Diffstat (limited to 'deps/npm/test/tap/add-remote-git.js')
-rw-r--r-- | deps/npm/test/tap/add-remote-git.js | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/deps/npm/test/tap/add-remote-git.js b/deps/npm/test/tap/add-remote-git.js index 44294924f1..2a61963439 100644 --- a/deps/npm/test/tap/add-remote-git.js +++ b/deps/npm/test/tap/add-remote-git.js @@ -1,16 +1,14 @@ var fs = require('fs') var resolve = require('path').resolve -var osenv = require('osenv') var mkdirp = require('mkdirp') -var rimraf = require('rimraf') var test = require('tap').test var npm = require('../../lib/npm.js') var common = require('../common-tap.js') -var pkg = common.pkg -var repo = pkg + '-repo' +var pkg = resolve(common.pkg, 'package') +var repo = resolve(pkg, 'repo') var daemon var daemonPID @@ -30,7 +28,8 @@ var pjChild = JSON.stringify({ }, null, 2) + '\n' test('setup', function (t) { - bootstrap() + mkdirp.sync(pkg) + fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) setup(function (er, r) { t.ifError(er, 'git started up successfully') @@ -47,25 +46,15 @@ test('install from repo', function (t) { process.chdir(pkg) npm.commands.install('.', [], function (er) { t.ifError(er, 'npm installed via git') - t.end() }) }) test('clean', function (t) { - daemon.on('close', function () { - cleanup() - t.end() - }) + daemon.on('close', t.end) process.kill(daemonPID) }) -function bootstrap () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) -} - function setup (cb) { mkdirp.sync(repo) fs.writeFileSync(resolve(repo, 'package.json'), pjChild) @@ -113,9 +102,3 @@ function setup (cb) { }, cb) }) } - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(repo) - rimraf.sync(pkg) -} |