@@ -30,14 +30,35 @@ describe('install route', () => {
30
30
31
31
describe ( 'npm success with results' , ( ) => {
32
32
beforeEach ( function ( ) {
33
- this . rows = [
34
- { key : [ 'yeoman-generator' , 'generator-unicorn' , 'some unicorn' ] } ,
35
- { key : [ 'yeoman-generator' , 'generator-unrelated' , 'some description' ] } ,
36
- { key : [ 'yeoman-generator' , 'generator-unicorn-1' , 'foo description' ] } ,
37
- { key : [ 'yeoman-generator' , 'generator-foo' , 'description with unicorn word' ] } ,
38
- { key : [ 'yeoman-generator' , 'generator-blacklist-1' , 'foo description' ] } ,
39
- { key : [ 'yeoman-generator' , 'generator-blacklist-2' , 'foo description' ] } ,
40
- { key : [ 'yeoman-generator' , 'generator-blacklist-3' , 'foo description' ] }
33
+ this . packages = [
34
+ {
35
+ name : 'generator-unicorn' ,
36
+ description : 'some unicorn'
37
+ } ,
38
+ {
39
+ name : 'generator-unrelated' ,
40
+ description : 'some description'
41
+ } ,
42
+ {
43
+ name : 'generator-unicorn-1' ,
44
+ description : 'foo description'
45
+ } ,
46
+ {
47
+ name : 'generator-foo' ,
48
+ description : 'description with unicorn word'
49
+ } ,
50
+ {
51
+ name : 'generator-blacklist-1' ,
52
+ description : 'foo description'
53
+ } ,
54
+ {
55
+ name : 'generator-blacklist-2' ,
56
+ description : 'foo description'
57
+ } ,
58
+ {
59
+ name : 'generator-blacklist-3' ,
60
+ description : 'foo description'
61
+ }
41
62
] ;
42
63
43
64
this . blacklist = [
@@ -46,15 +67,20 @@ describe('install route', () => {
46
67
] ;
47
68
48
69
this . pkgData = {
49
- author : {
50
- name : 'Simon'
70
+ 'dist-tags' : {
71
+ latest : '1.0.0'
72
+ } ,
73
+ versions : {
74
+ '1.0.0' : {
75
+ name : 'test'
76
+ }
51
77
}
52
78
} ;
53
79
54
80
nock ( registryUrl )
55
- . get ( '/-/_view/byKeyword ' )
81
+ . get ( '/-/v1/search ' )
56
82
. query ( true )
57
- . reply ( 200 , { rows : this . rows } )
83
+ . reply ( 200 , { objects : this . packages . map ( data => ( { package : data } ) ) } )
58
84
. filteringPath ( / \/ [ ^ ? ] + $ / g, '/pkg' )
59
85
. get ( '/pkg' )
60
86
. times ( 4 )
@@ -176,12 +202,22 @@ describe('install route', () => {
176
202
describe ( 'npm success without results' , ( ) => {
177
203
beforeEach ( ( ) => {
178
204
nock ( registryUrl )
179
- . get ( '/-/_view/byKeyword ' )
205
+ . get ( '/-/v1/search ' )
180
206
. query ( true )
181
207
. reply ( 200 , {
182
- rows : [
183
- { key : [ 'yeoman-generator' , 'generator-unrelated' , 'some description' ] } ,
184
- { key : [ 'yeoman-generator' , 'generator-unrelevant' , 'some description' ] }
208
+ objects : [
209
+ {
210
+ package : {
211
+ name : 'generator-unrelated' ,
212
+ description : 'some description'
213
+ }
214
+ } ,
215
+ {
216
+ package : {
217
+ name : 'generator-unrelevant' ,
218
+ description : 'some description'
219
+ }
220
+ }
185
221
]
186
222
} ) ;
187
223
} ) ;
0 commit comments