@@ -129,7 +129,7 @@ t.test('deprecates given range', async t => {
129
129
} )
130
130
131
131
t . test ( 'deprecates all versions when no range is specified' , async t => {
132
- const { npm, joinedOutput } = await loadMockNpm ( t , { config : { ...auth } } )
132
+ const { npm, logs , joinedOutput } = await loadMockNpm ( t , { config : { ...auth } } )
133
133
const registry = new MockRegistry ( {
134
134
tap : t ,
135
135
registry : npm . config . get ( 'registry' ) ,
@@ -151,6 +151,37 @@ t.test('deprecates all versions when no range is specified', async t => {
151
151
} ) . reply ( 200 , { } )
152
152
153
153
await npm . exec ( 'deprecate' , [ 'foo' , message ] )
154
+ t . match ( logs . notice , [
155
+ `deprecating [email protected] with message "${ message } "` ,
156
+ `deprecating [email protected] with message "${ message } "` ,
157
+ `deprecating [email protected] with message "${ message } "` ,
158
+ ] )
159
+ t . match ( joinedOutput ( ) , '' )
160
+ } )
161
+
162
+ t . test ( 'dry-run' , async t => {
163
+ const { npm, logs, joinedOutput } = await loadMockNpm ( t , { config : {
164
+ 'dry-run' : true ,
165
+ ...auth ,
166
+ } } )
167
+ const registry = new MockRegistry ( {
168
+ tap : t ,
169
+ registry : npm . config . get ( 'registry' ) ,
170
+ authorization : token ,
171
+ } )
172
+ const manifest = registry . manifest ( {
173
+ name : 'foo' ,
174
+ versions,
175
+ } )
176
+ await registry . package ( { manifest, query : { write : true } } )
177
+ const message = 'test deprecation message'
178
+
179
+ await npm . exec ( 'deprecate' , [ 'foo' , message ] )
180
+ t . match ( logs . notice , [
181
+ `deprecating [email protected] with message "${ message } "` ,
182
+ `deprecating [email protected] with message "${ message } "` ,
183
+ `deprecating [email protected] with message "${ message } "` ,
184
+ ] )
154
185
t . match ( joinedOutput ( ) , '' )
155
186
} )
156
187
0 commit comments