Skip to content

Commit

Permalink
test: clean up some unnecessary setup/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 1, 2019
1 parent 9bb66e1 commit 99edd49
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions test/tap/cache-shasum-fork.js
Expand Up @@ -3,8 +3,6 @@ var path = require('path')

var mkdirp = require('mkdirp')
var mr = require('npm-registry-mock')
var osenv = require('osenv')
var rimraf = require('rimraf')
var test = require('tap').test

var common = require('../common-tap.js')
Expand All @@ -19,7 +17,8 @@ var cache = common.cache
var server

test('setup', function (t) {
setup()
mkdirp.sync(path.join(pkg, 'node_modules'))
process.chdir(pkg)
t.comment('test for https://github.com/npm/npm/issues/3265')
mr({ port: common.port }, function (er, s) {
server = s
Expand All @@ -28,7 +27,6 @@ test('setup', function (t) {
})

test('npm cache - install from fork', function (t) {
setup()
common.npm(
[
'--loglevel', 'silent',
Expand Down Expand Up @@ -60,7 +58,6 @@ test('npm cache - install from fork', function (t) {

// Now install the real 1.5.1.
test('npm cache - install from origin', function (t) {
setup()
common.npm(
[
'--loglevel', 'silent',
Expand Down Expand Up @@ -91,17 +88,5 @@ test('npm cache - install from origin', function (t) {

test('cleanup', function (t) {
server.close()
cleanup()
t.end()
})

function cleanup () {
process.chdir(osenv.tmpdir())
rimraf.sync(pkg)
}

function setup () {
mkdirp.sync(cache)
mkdirp.sync(path.join(pkg, 'node_modules'))
process.chdir(pkg)
}

0 comments on commit 99edd49

Please sign in to comment.