Skip to content

Commit

Permalink
fixed wrong callback definition in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMesser committed Feb 7, 2023
1 parent 8731858 commit 7c00bb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -331,6 +331,5 @@ describe("query builder > insertion > on conflict", () => {

expect(sql).to.throw(Error)
}),
)
})
))
})
40 changes: 16 additions & 24 deletions test/github-issues/4764/issue-4764.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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)"
Expand All @@ -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)"
Expand All @@ -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)"
Expand All @@ -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)"
Expand All @@ -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)"
Expand All @@ -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)"
Expand All @@ -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)"
Expand All @@ -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
Expand Down

0 comments on commit 7c00bb8

Please sign in to comment.