@@ -20,10 +20,16 @@ function mocks (server) {
20
20
server . get ( '/-/package/@scoped%2fpkg/dist-tags' )
21
21
. reply ( 200 , { latest : '1.0.0' , a : '0.0.1' , b : '0.5.0' } )
22
22
23
+ server . get ( '/-/package/@scoped%2fpkg/dist-tags' )
24
+ . reply ( 200 , { latest : '1.0.0' , a : '0.0.1' , b : '0.5.0' } )
25
+
23
26
// ls named package
24
27
server . get ( '/-/package/@scoped%2fanother/dist-tags' )
25
28
. reply ( 200 , { latest : '2.0.0' , a : '0.0.2' , b : '0.6.0' } )
26
29
30
+ server . get ( '/-/package/@scoped%2fanother/dist-tags' )
31
+ . reply ( 200 , { latest : '2.0.0' , a : '0.0.2' , b : '0.6.0' } )
32
+
27
33
// add c
28
34
server . get ( '/-/package/@scoped%2fanother/dist-tags' )
29
35
. reply ( 200 , { latest : '2.0.0' , a : '0.0.2' , b : '0.6.0' } )
@@ -83,6 +89,25 @@ test('npm dist-tags ls in current package', function (t) {
83
89
)
84
90
} )
85
91
92
+ test ( 'npm dist-tags ls default in current package' , function ( t ) {
93
+ common . npm (
94
+ [
95
+ 'dist-tags' ,
96
+ '--registry' , common . registry ,
97
+ '--loglevel' , 'silent'
98
+ ] ,
99
+ { cwd : pkg } ,
100
+ function ( er , code , stdout , stderr ) {
101
+ t . ifError ( er , 'npm access' )
102
+ t . notOk ( code , 'exited OK' )
103
+ t . notOk ( stderr , 'no error output' )
104
+ t . equal ( stdout , 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n' )
105
+
106
+ t . end ( )
107
+ }
108
+ )
109
+ } )
110
+
86
111
test ( 'npm dist-tags ls on named package' , function ( t ) {
87
112
common . npm (
88
113
[
@@ -103,6 +128,26 @@ test('npm dist-tags ls on named package', function (t) {
103
128
)
104
129
} )
105
130
131
+ test ( 'npm dist-tags ls default, named package' , function ( t ) {
132
+ common . npm (
133
+ [
134
+ 'dist-tags' ,
135
+ '@scoped/another' ,
136
+ '--registry' , common . registry ,
137
+ '--loglevel' , 'silent'
138
+ ] ,
139
+ { cwd : pkg } ,
140
+ function ( er , code , stdout , stderr ) {
141
+ t . ifError ( er , 'npm access' )
142
+ t . notOk ( code , 'exited OK' )
143
+ t . notOk ( stderr , 'no error output' )
144
+ t . equal ( stdout , 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n' )
145
+
146
+ t . end ( )
147
+ }
148
+ )
149
+ } )
150
+
106
151
test ( 'npm dist-tags add @scoped/another@7.7.7 c' , function ( t ) {
107
152
common . npm (
108
153
[
0 commit comments