budibase/packages/server/__mocks__/pg.ts

26 lines
298 B
TypeScript
Raw Normal View History

2024-03-19 17:50:48 +01:00
const query = jest.fn(() => ({
rows: [
{
a: "string",
b: 1,
},
],
}))
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()
}
2024-03-19 17:50:48 +01:00
const on = jest.fn()
2024-03-19 17:50:48 +01:00
module.exports = {
Client,
queryMock: query,
on,
}