File tree Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ class View extends BaseCommand {
336336 email : color . cyan ( manifest . _npmUser . email ) ,
337337 } ) ,
338338 modified : ! packument . time ? undefined
339- : color . yellow ( relativeDate ( packument . time [ packument . version ] ) ) ,
339+ : color . yellow ( relativeDate ( packument . time [ manifest . version ] ) ) ,
340340 maintainers : ( packument . maintainers || [ ] ) . map ( ( u ) => unparsePerson ( {
341341 name : color . yellow ( u . name ) ,
342342 email : color . cyan ( u . email ) ,
Original file line number Diff line number Diff line change 8282dist-tags:
8383[1m[32mlatest[39m[22m: 1.0.0
8484
85- published {TIME} ago [39m
85+ published [33myesterday [39m
8686`
8787
8888exports [ `test/lib/view.js TAP should log info of package in current working dir specific version > must match snapshot 1` ] = `
9999dist-tags:
100100[1m[32mlatest[39m[22m: 1.0.0
101101
102- published {TIME} ago [39m
102+ published [33myesterday [39m
103103`
104104
105105exports [ `test/lib/view.js TAP should log package info package from git > must match snapshot 1` ] = `
@@ -302,7 +302,24 @@ dist
302302dist-tags:
303303[1m[32mlatest[39m[22m: 1.0.0
304304
305- published {TIME} ago[39m
305+ published [33myesterday[39m
306+ `
307+
308+ exports [ `test/lib/view.js TAP should log package info package with semver range > must match snapshot 1` ] = `
309+
310+
311+ [4m[1m[32mblue[39m@[32m1.0.0[39m[22m[24m | [1m[31mProprietary[39m[22m | deps: [32mnone[39m | versions: [33m2[39m
312+
313+ dist
314+ .tarball:[36mhttp://hm.blue.com/1.0.0.tgz[39m
315+ .shasum:[33m123[39m
316+ .integrity:[33m---[39m
317+ .unpackedSize:[33m1 B[39m
318+
319+ dist-tags:
320+ [1m[32mlatest[39m[22m: 1.0.0
321+
322+ published [33myesterday[39m
306323`
307324
308325exports [ `test/lib/view.js TAP workspaces all workspaces --json > must match snapshot 1` ] = `
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ const cleanLogs = () => {
1717 console . log = fn
1818}
1919
20+ // 25 hours ago
21+ const yesterday = new Date ( Date . now ( ) - 1000 * 60 * 60 * 25 )
22+
2023const packument = ( nv , opts ) => {
2124 if ( ! opts . fullMetadata )
2225 throw new Error ( 'must fetch fullMetadata' )
@@ -40,7 +43,7 @@ const packument = (nv, opts) => {
4043 latest : '1.0.0' ,
4144 } ,
4245 time : {
43- '1.0.0' : '2019-08-06T16:21:09.842Z' ,
46+ '1.0.0' : yesterday ,
4447 } ,
4548 versions : {
4649 '1.0.0' : {
@@ -332,6 +335,13 @@ t.test('should log package info', t => {
332335 } )
333336 } )
334337
338+ t . test ( 'package with semver range' , t => {
339+ view . exec ( [ 'blue@^1.0.0' ] , ( ) => {
340+ t . matchSnapshot ( logs )
341+ t . end ( )
342+ } )
343+ } )
344+
335345 t . test ( 'package with no modified time' , t => {
336346 viewUnicode . exec ( [ 'cyan@1.0.0' ] , ( ) => {
337347 t . matchSnapshot ( logs )
You can’t perform that action at this time.
0 commit comments