fix tests

This commit is contained in:
Martin McKeaveney 2021-05-24 12:14:04 +01:00
parent 495a255987
commit be7a8cfb8c
2 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,14 @@ mssql.query = jest.fn(() => ({
],
}))
mssql.connect = jest.fn(() => ({ recordset: [] }))
// mssql.connect = jest.fn(() => ({ recordset: [] }))
mssql.ConnectionPool = jest.fn(() => ({
connect: jest.fn(() => ({
request: jest.fn(() => ({
query: jest.fn(() => ({})),
})),
})),
}))
module.exports = mssql

View File

@ -32,7 +32,8 @@ describe("MS SQL Server Integration", () => {
})
describe("no rows returned", () => {
beforeEach(() => {
beforeEach(async () => {
await config.integration.connect()
config.integration.client.query.mockImplementation(() => ({ rows: [] }))
})