2021-03-09 12:56:32 +01:00
|
|
|
const pg = {}
|
|
|
|
|
|
|
|
// constructor
|
2021-03-15 17:07:04 +01:00
|
|
|
function Client() {
|
|
|
|
this.query = jest.fn(() => ({ rows: [] }))
|
2021-03-09 12:56:32 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 17:07:04 +01:00
|
|
|
Client.prototype.query = jest.fn(() => ({
|
|
|
|
rows: [
|
|
|
|
{
|
|
|
|
a: "string",
|
|
|
|
b: 1,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}))
|
|
|
|
|
|
|
|
Client.prototype.connect = jest.fn()
|
2021-03-09 12:56:32 +01:00
|
|
|
|
|
|
|
pg.Client = Client
|
|
|
|
|
|
|
|
module.exports = pg
|