fixed wrong callback definition in tests

This commit is contained in:
Dmitry Zotov 2023-02-07 12:50:58 +05:00
parent 8731858fbc
commit 7c00bb8e0e
2 changed files with 18 additions and 27 deletions

View File

@ -303,7 +303,7 @@ describe("query builder > insertion > on conflict", () => {
)
}),
))
it("should throw error if using indexPredicate amd an unsupported driver", () => {
it("should throw error if using indexPredicate amd an unsupported driver", () =>
Promise.all(
connections.map(async (connection) => {
if (
@ -331,6 +331,5 @@ describe("query builder > insertion > on conflict", () => {
expect(sql).to.throw(Error)
}),
)
})
))
})

View File

@ -33,7 +33,7 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
// -------------------------------------------------------------------------
// Specifications
// -------------------------------------------------------------------------
it("should not have Lock clause", async () => {
it("should not have Lock clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (NOLOCK)"
@ -49,10 +49,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have WITH (NOLOCK) clause", async () => {
it("should have WITH (NOLOCK) clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (NOLOCK)"
@ -69,10 +68,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have two WITH (NOLOCK) clause", async () => {
it("should have two WITH (NOLOCK) clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (NOLOCK)"
@ -90,10 +88,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have three WITH (NOLOCK) clause", async () => {
it("should have three WITH (NOLOCK) clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (NOLOCK)"
@ -112,10 +109,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have three WITH (NOLOCK) clause (without relation)", async () => {
it("should have three WITH (NOLOCK) clause (without relation)", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (NOLOCK)"
@ -138,10 +134,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have WITH (HOLDLOCK, ROWLOCK) clause", async () => {
it("should have WITH (HOLDLOCK, ROWLOCK) clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (HOLDLOCK, ROWLOCK)"
@ -158,10 +153,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have WITH (UPLOCK, ROWLOCK) clause", async () => {
it("should have WITH (UPLOCK, ROWLOCK) clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (UPDLOCK, ROWLOCK)"
@ -178,10 +172,9 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
it("should have two WITH (UPDLOCK, ROWLOCK) clause", async () => {
it("should have two WITH (UPDLOCK, ROWLOCK) clause", () =>
Promise.all(
connections.map(async (connection) => {
const lock = " WITH (UPDLOCK, ROWLOCK)"
@ -199,8 +192,7 @@ describe("mssql > add lock clause for MSSQL select with join clause", () => {
await connection.query(selectQuery)
}),
)
})
))
function countInstances(str: string, word: string) {
return str.split(word).length - 1