@@ -54,6 +54,24 @@ test('npm ls --dev', function (t) {
54
54
} )
55
55
} )
56
56
57
+ test ( 'npm ls --only=development' , function ( t ) {
58
+ common . npm ( [ 'ls' , '--only=development' ] , EXEC_OPTS , function ( er , code , stdout ) {
59
+ t . ifError ( er , 'ls --only=development ran without issue' )
60
+ t . equal ( code , 0 )
61
+ t . has ( stdout , / ( e m p t y ) / , 'output contains (empty)' )
62
+ t . end ( )
63
+ } )
64
+ } )
65
+
66
+ test ( 'npm ls --only=dev' , function ( t ) {
67
+ common . npm ( [ 'ls' , '--only=dev' ] , EXEC_OPTS , function ( er , code , stdout ) {
68
+ t . ifError ( er , 'ls --only=dev ran without issue' )
69
+ t . equal ( code , 0 )
70
+ t . has ( stdout , / ( e m p t y ) / , 'output contains (empty)' )
71
+ t . end ( )
72
+ } )
73
+ } )
74
+
57
75
test ( 'npm ls --production' , function ( t ) {
58
76
common . npm ( [ 'ls' , '--production' ] , EXEC_OPTS , function ( er , code , stdout ) {
59
77
t . ifError ( er , 'ls --production ran without issue' )
@@ -80,6 +98,32 @@ test('npm ls --prod', function (t) {
80
98
} )
81
99
} )
82
100
101
+ test ( 'npm ls --only=production' , function ( t ) {
102
+ common . npm ( [ 'ls' , '--only=production' ] , EXEC_OPTS , function ( er , code , stdout ) {
103
+ t . ifError ( er , 'ls --only=production ran without issue' )
104
+ t . notOk ( code , 'npm exited ok' )
105
+ t . has (
106
+ stdout ,
107
+ / t e s t - p a c k a g e - w i t h - o n e - d e p @ 0 \. 0 \. 0 / ,
108
+ 'output contains [email protected] '
109
+ )
110
+ t . end ( )
111
+ } )
112
+ } )
113
+
114
+ test ( 'npm ls --only=prod' , function ( t ) {
115
+ common . npm ( [ 'ls' , '--only=prod' ] , EXEC_OPTS , function ( er , code , stdout ) {
116
+ t . ifError ( er , 'ls --only=prod ran without issue' )
117
+ t . notOk ( code , 'npm exited ok' )
118
+ t . has (
119
+ stdout ,
120
+ / t e s t - p a c k a g e - w i t h - o n e - d e p @ 0 \. 0 \. 0 / ,
121
+ 'output contains [email protected] '
122
+ )
123
+ t . end ( )
124
+ } )
125
+ } )
126
+
83
127
test ( 'cleanup' , function ( t ) {
84
128
cleanup ( )
85
129
t . end ( )
0 commit comments