2024-03-19 17:50:48 +01:00
|
|
|
const query = jest.fn(() => ({
|
|
|
|
rows: [
|
|
|
|
{
|
|
|
|
a: "string",
|
|
|
|
b: 1,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}))
|
2021-06-25 14:46:02 +02:00
|
|
|
|
2024-03-19 17:50:48 +01:00
|
|
|
class Client {
|
|
|
|
query = query
|
|
|
|
end = jest.fn(cb => {
|
2022-05-20 19:08:48 +02:00
|
|
|
if (cb) cb()
|
|
|
|
})
|
2024-03-19 17:50:48 +01:00
|
|
|
connect = jest.fn()
|
|
|
|
release = jest.fn()
|
|
|
|
}
|
2021-06-25 14:46:02 +02:00
|
|
|
|
2024-03-19 17:50:48 +01:00
|
|
|
const on = jest.fn()
|
2021-06-25 14:46:02 +02:00
|
|
|
|
2024-03-19 17:50:48 +01:00
|
|
|
module.exports = {
|
|
|
|
Client,
|
|
|
|
queryMock: query,
|
|
|
|
on,
|
2021-06-25 14:46:02 +02:00
|
|
|
}
|