File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,22 @@ describe("AQL queries", function() {
160160 expect ( Object . keys ( query . bindVars ) ) . to . eql ( [ "@value0" ] ) ;
161161 expect ( query . bindVars [ "@value0" ] ) . to . equal ( "tomato" ) ;
162162 } ) ;
163+ it ( "supports arbitrary types" , ( ) => {
164+ interface Whatever {
165+ color : string ;
166+ more : {
167+ x : number ;
168+ } ;
169+ }
170+ const whatever : Whatever [ ] = [
171+ { color : "green" , more : { x : 2 } } ,
172+ { color : "yellow" , more : { x : 3 } }
173+ ] ;
174+ const query = aql `${ whatever } ` ;
175+ expect ( query . query ) . to . equal ( "@value0" ) ;
176+ expect ( Object . keys ( query . bindVars ) ) . to . eql ( [ "value0" ] ) ;
177+ expect ( query . bindVars . value0 ) . to . equal ( whatever ) ;
178+ } ) ;
163179 it ( "supports AQL literals" , ( ) => {
164180 const query = aql `FOR x IN whatever ${ aql . literal (
165181 "FILTER x.blah"
You can’t perform that action at this time.
0 commit comments