Skip to content

Commit

Permalink
test: escape table name for Github #4410 (#6672)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Sep 5, 2020
1 parent fa21f87 commit 802e0f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/github-issues/4410/issue-4410.ts
Expand Up @@ -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));
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 802e0f6

Please sign in to comment.