File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -163,3 +163,23 @@ test('types are exported', function() {
163163 var pg = require ( __dirname + '/../../lib/index' ) ;
164164 assert . ok ( pg . types ) ;
165165} ) ;
166+
167+ test ( 'normalizing query configs' , function ( ) {
168+ var config
169+ var callback = function ( ) { }
170+
171+ config = utils . normalizeQueryConfig ( { text : 'TEXT' } )
172+ assert . same ( config , { text : 'TEXT' } )
173+
174+ config = utils . normalizeQueryConfig ( { text : 'TEXT' } , [ 10 ] )
175+ assert . deepEqual ( config , { text : 'TEXT' , values : [ 10 ] } )
176+
177+ config = utils . normalizeQueryConfig ( { text : 'TEXT' , values : [ 10 ] } )
178+ assert . deepEqual ( config , { text : 'TEXT' , values : [ 10 ] } )
179+
180+ config = utils . normalizeQueryConfig ( 'TEXT' , [ 10 ] , callback )
181+ assert . deepEqual ( config , { text : 'TEXT' , values : [ 10 ] , callback : callback } )
182+
183+ config = utils . normalizeQueryConfig ( { text : 'TEXT' , values : [ 10 ] } , callback )
184+ assert . deepEqual ( config , { text : 'TEXT' , values : [ 10 ] , callback : callback } )
185+ } )
You can’t perform that action at this time.
0 commit comments