Skip to content

Commit 357bb4e

Browse files
committed
Add test for #575
1 parent c5e33da commit 357bb4e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/05-aql-queries.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)