File tree Expand file tree Collapse file tree 3 files changed +255
-181
lines changed 
tap-snapshots/test/lib/commands Expand file tree Collapse file tree 3 files changed +255
-181
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ class TextOutputStream extends Minipass {
9595    // Normalize 
9696    const  pkg  =  { 
9797      authors : data . maintainers . map ( ( m )  =>  `${ strip ( m . username ) }  ) . join ( ' ' ) , 
98-       publisher : strip ( data . publisher . username ) , 
98+       publisher : strip ( data . publisher ? .username   ||   '' ) , 
9999      date : data . date  ? data . date . toISOString ( ) . slice ( 0 ,  10 )  : 'prehistoric' , 
100100      description : strip ( data . description  ??  '' ) , 
101101      keywords : [ ] , 
@@ -159,7 +159,11 @@ class TextOutputStream extends Minipass {
159159    }  else  { 
160160      output  =  `${ name }  
161161    } 
162-     output  +=  `Version ${ this . #chalk. blue ( pkg . version ) } ${ this . #chalk. blue ( pkg . date ) } ${ this . #chalk. blue ( pkg . publisher ) }  
162+     if  ( pkg . publisher )  { 
163+       output  +=  `Version ${ this . #chalk. blue ( pkg . version ) } ${ this . #chalk. blue ( pkg . date ) } ${ this . #chalk. blue ( pkg . publisher ) }  
164+     }  else  { 
165+       output  +=  `Version ${ this . #chalk. blue ( pkg . version ) } ${ this . #chalk. blue ( pkg . date ) } ${ this . #chalk. yellow ( '???' ) }  
166+     } 
163167    output  +=  `Maintainers: ${ pkg . authors }  
164168    if  ( keywords )  { 
165169      output  +=  `Keywords: ${ keywords }  
Original file line number Diff line number Diff line change 55 * Make sure to inspect the output below.  Do not ignore changes! 
66 */ 
77'use strict' 
8- exports [ `test/lib/commands/search.js TAP empty search results > should have expected search results 1` ]  =  ` 
9- No matches found for "foo" 
10- ` 
11- 
128exports [ `test/lib/commands/search.js TAP search /<name>/--color > should have expected search results with color 1` ]  =  ` 
139[34mlibnpm[39m 
1410Collection of programmatic APIs for the npm CLI 
189185Version 1.0.0 published prehistoric by foo 
190186Maintainers: foo 
191187https://npm.im/foo 
188+ custom-registry 
189+ Version 1.0.0 published prehistoric by ??? 
190+ Maintainers: foo 
191+ https://npm.im/custom-registry 
192192libnpmversion 
193193Version 1.0.0 published prehistoric by foo 
194194Maintainers: foo 
@@ -274,6 +274,10 @@ Maintainers: lukekarrys
274274https://npm.im/pkg-no-desc 
275275` 
276276
277+ exports [ `test/lib/commands/search.js TAP search empty search results > should have expected search results 1` ]  =  ` 
278+ No matches found for "foo" 
279+ ` 
280+ 
277281exports [ `test/lib/commands/search.js TAP search exclude forward slash > results should not have libnpmversion 1` ]  =  ` 
278282libnpm 
279283Collection of programmatic APIs for the npm CLI 
@@ -1009,3 +1013,14 @@ Version 1.0.0 published 2019-09-26 by lukekarrys
10091013Maintainers: lukekarrys 
10101014https://npm.im/pkg-no-desc 
10111015` 
1016+ 
1017+ exports [ `test/lib/commands/search.js TAP search no publisher > should have filtered expected search results 1` ]  =  ` 
1018+ custom-registry 
1019+ Version 1.0.0 published prehistoric by ??? 
1020+ Maintainers: foo 
1021+ https://npm.im/custom-registry 
1022+ libnpmversion 
1023+ Version 1.0.0 published prehistoric by foo 
1024+ Maintainers: foo 
1025+ https://npm.im/libnpmversion 
1026+ ` 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments