1
0
Fork 0
mirror of synced 2024-07-01 20:41:03 +12:00
budibase/packages/server/__mocks__/pg.ts
2022-04-28 23:24:52 +01:00

29 lines
443 B
TypeScript

module PgMock {
const pg: any = {}
const query = jest.fn(() => ({
rows: [
{
a: "string",
b: 1,
},
],
}))
// constructor
function Client() {}
Client.prototype.query = query
Client.prototype.end = jest.fn()
Client.prototype.connect = jest.fn()
Client.prototype.release = jest.fn()
const on = jest.fn()
pg.Client = Client
pg.queryMock = query
pg.on = on
module.exports = pg
}