File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ class View extends BaseCommand {
208
208
209
209
if ( pckmnt . time && pckmnt . time . unpublished ) {
210
210
const u = pckmnt . time . unpublished
211
- const er = new Error ( ' Unpublished by ' + u . name + ' on ' + u . time )
211
+ const er = new Error ( ` Unpublished on ${ u . time } ` )
212
212
er . statusCode = 404
213
213
er . code = 'E404'
214
214
er . pkgid = pckmnt . _id
Original file line number Diff line number Diff line change @@ -32,12 +32,15 @@ const packument = (nv, opts) => {
32
32
33
33
const mocks = {
34
34
red : {
35
+ _id : 'red@1.0.1' ,
35
36
name : 'red' ,
36
37
'dist-tags' : {
37
38
'1.0.1' : { } ,
38
39
} ,
39
40
time : {
40
- unpublished : new Date ( ) ,
41
+ unpublished : {
42
+ time : '2012-12-20T00:00:00.000Z' ,
43
+ } ,
41
44
} ,
42
45
} ,
43
46
blue : {
@@ -533,7 +536,7 @@ t.test('throws when unpublished', async t => {
533
536
const view = new View ( npm )
534
537
await t . rejects (
535
538
view . exec ( [ 'red' ] ) ,
536
- { code : 'E404' }
539
+ { code : 'E404' , pkgid : 'red@1.0.1' , message : 'Unpublished on 2012-12-20T00:00:00.000Z' }
537
540
)
538
541
} )
539
542
You can’t perform that action at this time.
0 commit comments