File tree 3 files changed +255
-181
lines changed
tap-snapshots/test/lib/commands
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 {
95
95
// Normalize
96
96
const pkg = {
97
97
authors : data . maintainers . map ( ( m ) => `${ strip ( m . username ) } ` ) . join ( ' ' ) ,
98
- publisher : strip ( data . publisher . username ) ,
98
+ publisher : strip ( data . publisher ? .username || '' ) ,
99
99
date : data . date ? data . date . toISOString ( ) . slice ( 0 , 10 ) : 'prehistoric' ,
100
100
description : strip ( data . description ?? '' ) ,
101
101
keywords : [ ] ,
@@ -159,7 +159,11 @@ class TextOutputStream extends Minipass {
159
159
} else {
160
160
output = `${ name } \n`
161
161
}
162
- output += `Version ${ this . #chalk. blue ( pkg . version ) } published ${ this . #chalk. blue ( pkg . date ) } by ${ this . #chalk. blue ( pkg . publisher ) } \n`
162
+ if ( pkg . publisher ) {
163
+ output += `Version ${ this . #chalk. blue ( pkg . version ) } published ${ this . #chalk. blue ( pkg . date ) } by ${ this . #chalk. blue ( pkg . publisher ) } \n`
164
+ } else {
165
+ output += `Version ${ this . #chalk. blue ( pkg . version ) } published ${ this . #chalk. blue ( pkg . date ) } by ${ this . #chalk. yellow ( '???' ) } \n`
166
+ }
163
167
output += `Maintainers: ${ pkg . authors } \n`
164
168
if ( keywords ) {
165
169
output += `Keywords: ${ keywords } \n`
Original file line number Diff line number Diff line change 5
5
* Make sure to inspect the output below. Do not ignore changes!
6
6
*/
7
7
'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
-
12
8
exports [ `test/lib/commands/search.js TAP search /<name>/--color > should have expected search results with color 1` ] = `
13
9
[34mlibnpm[39m
14
10
Collection of programmatic APIs for the npm CLI
189
185
Version 1.0.0 published prehistoric by foo
190
186
Maintainers: foo
191
187
https://npm.im/foo
188
+ custom-registry
189
+ Version 1.0.0 published prehistoric by ???
190
+ Maintainers: foo
191
+ https://npm.im/custom-registry
192
192
libnpmversion
193
193
Version 1.0.0 published prehistoric by foo
194
194
Maintainers: foo
@@ -274,6 +274,10 @@ Maintainers: lukekarrys
274
274
https://npm.im/pkg-no-desc
275
275
`
276
276
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
+
277
281
exports [ `test/lib/commands/search.js TAP search exclude forward slash > results should not have libnpmversion 1` ] = `
278
282
libnpm
279
283
Collection of programmatic APIs for the npm CLI
@@ -1009,3 +1013,14 @@ Version 1.0.0 published 2019-09-26 by lukekarrys
1009
1013
Maintainers: lukekarrys
1010
1014
https://npm.im/pkg-no-desc
1011
1015
`
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