1
0
Fork 0
mirror of synced 2024-08-14 01:21:41 +12:00
budibase/packages/server/__mocks__/pg.ts

27 lines
408 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.connect = jest.fn()
Client.prototype.release = jest.fn()
const on = jest.fn()
pg.Client = Client
pg.queryMock = query
pg.on = on
module.exports = pg
}