@@ -3,8 +3,6 @@ var path = require('path')
3
3
4
4
var mkdirp = require ( 'mkdirp' )
5
5
var mr = require ( 'npm-registry-mock' )
6
- var osenv = require ( 'osenv' )
7
- var rimraf = require ( 'rimraf' )
8
6
var test = require ( 'tap' ) . test
9
7
10
8
var common = require ( '../common-tap.js' )
@@ -19,7 +17,8 @@ var cache = common.cache
19
17
var server
20
18
21
19
test ( 'setup' , function ( t ) {
22
- setup ( )
20
+ mkdirp . sync ( path . join ( pkg , 'node_modules' ) )
21
+ process . chdir ( pkg )
23
22
t . comment ( 'test for https://github.com/npm/npm/issues/3265' )
24
23
mr ( { port : common . port } , function ( er , s ) {
25
24
server = s
@@ -28,7 +27,6 @@ test('setup', function (t) {
28
27
} )
29
28
30
29
test ( 'npm cache - install from fork' , function ( t ) {
31
- setup ( )
32
30
common . npm (
33
31
[
34
32
'--loglevel' , 'silent' ,
@@ -60,7 +58,6 @@ test('npm cache - install from fork', function (t) {
60
58
61
59
// Now install the real 1.5.1.
62
60
test ( 'npm cache - install from origin' , function ( t ) {
63
- setup ( )
64
61
common . npm (
65
62
[
66
63
'--loglevel' , 'silent' ,
@@ -91,17 +88,5 @@ test('npm cache - install from origin', function (t) {
91
88
92
89
test ( 'cleanup' , function ( t ) {
93
90
server . close ( )
94
- cleanup ( )
95
91
t . end ( )
96
92
} )
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