2021-06-25 14:46:02 +02:00
|
|
|
module MsSqlMock {
|
|
|
|
const mssql: any = {}
|
|
|
|
|
|
|
|
mssql.query = jest.fn(() => ({
|
|
|
|
recordset: [
|
|
|
|
{
|
|
|
|
a: "string",
|
|
|
|
b: 1,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}))
|
|
|
|
|
2022-01-20 09:17:08 +01:00
|
|
|
// mssql.connect = jest.fn(() => ({ recordset: [] }))
|
2021-06-25 14:46:02 +02:00
|
|
|
|
|
|
|
mssql.ConnectionPool = jest.fn(() => ({
|
|
|
|
connect: jest.fn(() => ({
|
|
|
|
request: jest.fn(() => ({
|
2022-01-20 09:17:08 +01:00
|
|
|
query: jest.fn(sql => ({ recordset: [sql] })),
|
2021-06-25 14:46:02 +02:00
|
|
|
})),
|
|
|
|
})),
|
|
|
|
}))
|
|
|
|
|
|
|
|
module.exports = mssql
|
2022-01-20 09:17:08 +01:00
|
|
|
}
|