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 @@ -176,6 +176,22 @@ describe("AQL queries", function() {
176176 expect ( Object . keys ( query . bindVars ) ) . to . eql ( [ "value0" ] ) ;
177177 expect ( query . bindVars . value0 ) . to . equal ( whatever ) ;
178178 } ) ;
179+ it ( "supports arbitrary classes" , ( ) => {
180+ class Whatever {
181+ color : string ;
182+ constructor ( color : string ) {
183+ this . color = color ;
184+ }
185+ }
186+ const whatever : Whatever [ ] = [
187+ new Whatever ( "green" ) ,
188+ new Whatever ( "yellow" )
189+ ] ;
190+ const query = aql `${ whatever } ` ;
191+ expect ( query . query ) . to . equal ( "@value0" ) ;
192+ expect ( Object . keys ( query . bindVars ) ) . to . eql ( [ "value0" ] ) ;
193+ expect ( query . bindVars . value0 ) . to . equal ( whatever ) ;
194+ } ) ;
179195 it ( "supports AQL literals" , ( ) => {
180196 const query = aql `FOR x IN whatever ${ aql . literal (
181197 "FILTER x.blah"
You can’t perform that action at this time.
0 commit comments