@@ -65,37 +65,49 @@ var installJSON = {
65
65
66
66
test ( 'setup' , function ( t ) {
67
67
setup ( )
68
- common . npm ( [ 'ls' , '-g' , '--depth=0' ] , OPTS , function ( err , c , out ) {
69
- t . ifError ( err )
70
- t . equal ( c , 0 , 'set up ok' )
71
- t . notOk ( out . match ( / U N M E T D E P E N D E N C Y f o o @ / ) , "foo isn't in global" )
68
+ common . npm ( [ 'ls' , '-g' , '--depth=0' ] , OPTS , function ( err , code , stdout , stderr ) {
69
+ if ( err ) throw err
70
+ t . comment ( stdout )
71
+ t . comment ( stderr )
72
+ t . is ( code , 0 , 'ls -g' )
73
+ t . notMatch ( stdout , / U N M E T D E P E N D E N C Y f o o @ / , "foo isn't in global" )
72
74
t . end ( )
73
75
} )
74
76
} )
75
77
76
78
test ( 'creates global link' , function ( t ) {
77
79
process . chdir ( link )
78
- common . npm ( [ 'link' ] , OPTS , function ( err , c , out ) {
79
- t . ifError ( err , 'link has no error' )
80
- common . npm ( [ 'ls' , '-g' ] , OPTS , function ( err , c , out , stderr ) {
81
- t . ifError ( err )
82
- t . equal ( c , 0 )
80
+ common . npm ( [ 'link' ] , OPTS , function ( err , code , stdout , stderr ) {
81
+ if ( err ) throw err
82
+ t . is ( code , 0 , 'link' )
83
+ t . comment ( stdout )
84
+ t . comment ( stderr )
85
+ common . npm ( [ 'ls' , '-g' ] , OPTS , function ( err , code , stdout , stderr ) {
86
+ if ( err ) throw err
87
+ t . comment ( stdout )
88
+ t . comment ( stderr )
89
+ t . is ( code , 0 , 'ls -g' )
83
90
t . equal ( stderr , '' , 'got expected stderr' )
84
- t . has ( out , / f o o @ 1 .0 .0 / , 'creates global link ok' )
91
+ t . match ( stdout , / f o o @ 1 .0 .0 / , 'creates global link ok' )
85
92
t . end ( )
86
93
} )
87
94
} )
88
95
} )
89
96
90
97
test ( 'uninstall the global linked package' , function ( t ) {
91
98
process . chdir ( osenv . tmpdir ( ) )
92
- common . npm ( [ 'uninstall' , '-g' , 'foo' ] , OPTS , function ( err ) {
93
- t . ifError ( err , 'uninstall has no error' )
99
+ common . npm ( [ 'uninstall' , '-g' , 'foo' ] , OPTS , function ( err , code , stdout , stderr ) {
100
+ if ( err ) throw err
101
+ t . is ( code , 0 , 'uninstall -g foo' )
102
+ t . comment ( stdout )
103
+ t . comment ( stderr )
94
104
process . chdir ( link )
95
- common . npm ( [ 'ls' ] , OPTS , function ( err , c , out ) {
96
- t . ifError ( err )
97
- t . equal ( c , 0 )
98
- t . has ( out , / b a z @ 1 .0 .0 / , "uninstall didn't remove dep" )
105
+ common . npm ( [ 'ls' ] , OPTS , function ( err , code , stdout ) {
106
+ if ( err ) throw err
107
+ t . is ( code , 0 , 'ls' )
108
+ t . comment ( stdout )
109
+ t . comment ( stderr )
110
+ t . match ( stdout , / b a z @ 1 .0 .0 / , "uninstall didn't remove dep" )
99
111
t . end ( )
100
112
} )
101
113
} )
0 commit comments