Skip to content

Commit 99edd49

Browse files
committed
test: clean up some unnecessary setup/cleanup
1 parent 9bb66e1 commit 99edd49

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

test/tap/cache-shasum-fork.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ var path = require('path')
33

44
var mkdirp = require('mkdirp')
55
var mr = require('npm-registry-mock')
6-
var osenv = require('osenv')
7-
var rimraf = require('rimraf')
86
var test = require('tap').test
97

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

2119
test('setup', function (t) {
22-
setup()
20+
mkdirp.sync(path.join(pkg, 'node_modules'))
21+
process.chdir(pkg)
2322
t.comment('test for https://github.com/npm/npm/issues/3265')
2423
mr({ port: common.port }, function (er, s) {
2524
server = s
@@ -28,7 +27,6 @@ test('setup', function (t) {
2827
})
2928

3029
test('npm cache - install from fork', function (t) {
31-
setup()
3230
common.npm(
3331
[
3432
'--loglevel', 'silent',
@@ -60,7 +58,6 @@ test('npm cache - install from fork', function (t) {
6058

6159
// Now install the real 1.5.1.
6260
test('npm cache - install from origin', function (t) {
63-
setup()
6461
common.npm(
6562
[
6663
'--loglevel', 'silent',
@@ -91,17 +88,5 @@ test('npm cache - install from origin', function (t) {
9188

9289
test('cleanup', function (t) {
9390
server.close()
94-
cleanup()
9591
t.end()
9692
})
97-
98-
function cleanup () {
99-
process.chdir(osenv.tmpdir())
100-
rimraf.sync(pkg)
101-
}
102-
103-
function setup () {
104-
mkdirp.sync(cache)
105-
mkdirp.sync(path.join(pkg, 'node_modules'))
106-
process.chdir(pkg)
107-
}

0 commit comments

Comments
 (0)