From f75f8b5eb7005121e9729a71113db42771a4bf09 Mon Sep 17 00:00:00 2001 From: James Ward Date: Fri, 4 Sep 2020 21:06:33 -0400 Subject: [PATCH] escape table name for Github #4410 --- test/github-issues/4410/issue-4410.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/github-issues/4410/issue-4410.ts b/test/github-issues/4410/issue-4410.ts index 86ff3de1d7..cf23b9856f 100644 --- a/test/github-issues/4410/issue-4410.ts +++ b/test/github-issues/4410/issue-4410.ts @@ -14,7 +14,6 @@ describe("github issues > #4410 allow custom filepath for FileLogger", () => { schemaCreate: true, dropSchema: true, }; - const testQuery = "SELECT COUNT(*) from username;"; before(() => stub = sinon.stub(PlatformTools, "appendFileSync")); beforeEach(() => reloadTestingDatabases(connections)); @@ -29,8 +28,10 @@ describe("github issues > #4410 allow custom filepath for FileLogger", () => { createLogger: () => new FileLogger("all"), }); }); - it("writes to the base path", async () => + it("writes to the base path", async () => Promise.all(connections.map(async (connection) => { + const testQuery = `SELECT COUNT(*) FROM ${connection.driver.escape('username')}`; + await connection.query(testQuery); sinon.assert.calledWith( stub, @@ -51,6 +52,8 @@ describe("github issues > #4410 allow custom filepath for FileLogger", () => { }); it("writes to the given filename", async () => Promise.all(connections.map(async (connection) => { + const testQuery = `SELECT COUNT(*) FROM ${connection.driver.escape('username')}`; + await connection.query(testQuery); sinon.assert.calledWith( stub, @@ -71,6 +74,8 @@ describe("github issues > #4410 allow custom filepath for FileLogger", () => { }); it("writes to the given path", () => Promise.all(connections.map(async (connection) => { + const testQuery = `SELECT COUNT(*) FROM ${connection.driver.escape('username')}`; + await connection.query(testQuery); sinon.assert.calledWith( stub,