1
0
Fork 0
mirror of synced 2024-09-28 15:21:28 +12:00

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: [] }))
})