1
0
Fork 0
mirror of synced 2024-07-29 01:56:15 +12:00
budibase/packages/server/__mocks__/pg.ts

26 lines
298 B
TypeScript
Raw Normal View History

2024-03-20 05:50:48 +13:00
const query = jest.fn(() => ({
rows: [
{
a: "string",
b: 1,
},
],
}))
2024-03-20 05:50:48 +13:00
class Client {
query = query
end = jest.fn(cb => {
2022-05-21 05:08:48 +12:00
if (cb) cb()
})
2024-03-20 05:50:48 +13:00
connect = jest.fn()
release = jest.fn()
}
2024-03-20 05:50:48 +13:00
const on = jest.fn()
2024-03-20 05:50:48 +13:00
module.exports = {
Client,
queryMock: query,
on,
}