Skip to content

Commit

Permalink
Add select columns testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyball710 committed Jun 23, 2023
1 parent 3ecdc27 commit 1f6a55c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/querybuilder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ describe("Query Builder", () => {
expect(statement.bindings[0]).to.equal(1);
expect(statement.bindings[1]).to.equal("test");
});
it("should generate a query with a select columns", () => {
const statement = GenerateQuery(QueryType.SELECT, "test", {
columns: ["id", "name"]
});
expect(statement.query).to.equal("SELECT `id`, `name` FROM `test`");
});
it("should ignore an empty where clause object", () => {
const statement = GenerateQuery(QueryType.SELECT, "test", {
where: {},
Expand Down

0 comments on commit 1f6a55c

Please sign in to comment.