@@ -31,24 +31,27 @@ describe("commands/install", function() {
3131 result . reset ( ) ;
3232 } ) ;
3333
34-
3534 it ( 'reports no results when none match' , function ( done ) {
36- sinon . stub ( httpRequest , "get" ) . yields ( null , { statusCode :200 } , JSON . stringify ( { rows :[ ] } ) ) ;
35+ sinon . stub ( httpRequest , "get" ) . yields ( null , { statusCode :200 } , JSON . stringify ( { "objects" :[ ] , "total" : 0 , "time" : "Thu Feb 27 2020 11:27:22 GMT+0000 (UTC)" } ) ) ;
3736
3837 command ( { _ :[ null , "testnode" ] } , result ) . then ( function ( ) {
3938 result . log . called . should . be . true ;
40- result . log . args [ 0 ] [ 0 ] . should . eql ( "No results found" ) ;
39+ result . log . args [ 0 ] [ 0 ] . should . eql ( "total: 0 objects: 0 found" ) ;
40+ result . log . args [ 1 ] [ 0 ] . should . eql ( "No results found" ) ;
4141 done ( ) ;
4242 } ) . otherwise ( done ) ;
4343
4444 } ) ;
4545 it ( 'lists matched modules' , function ( done ) {
4646 sinon . stub ( httpRequest , "get" ) . yields ( null , { statusCode :200 } ,
47- JSON . stringify ( { rows :[
48- { key :[ "node-red" , "testnode" , "a random node" ] } ,
49- { key :[ "node-red" , "another" , "a testnode match" ] } ,
50- { key :[ "node-red" , "not a match" , "not a match" ] }
51- ] } )
47+ JSON . stringify ( {
48+ "objects" :[
49+ { "package" :{ "name" : "testnode" , "description" : "a random node" , "keywords" :[ "testnode" , "node-red" , "test" ] } } ,
50+ { "package" :{ "name" : "testnodes" , "description" : "a random nodes test" , "keywords" :[ "testnodes" , "node-red" , "tests" ] } }
51+ ] ,
52+ "total" :2 ,
53+ "time" :"Thu Feb 27 2020 11:27:22 GMT+0000 (UTC)"
54+ } )
5255 ) ;
5356
5457 command ( { _ :[ null , "testnode" ] } , result ) . then ( function ( ) {
0 commit comments