Fixing postgres datasource test.
This commit is contained in:
parent
5d8f348fc2
commit
43db0abef8
|
@ -94,7 +94,8 @@ describe("/datasources", () => {
|
|||
.expect(200)
|
||||
// this is mock data, can't test it
|
||||
expect(res.body).toBeDefined()
|
||||
expect(pg.queryMock).toHaveBeenCalledWith(`select "users"."name" as "users.name", "users"."age" as "users.age" from "users" where "users"."name" ilike $1 limit $2`, ["John%", 5000])
|
||||
const expSql = `select "users"."name" as "users.name", "users"."age" as "users.age" from (select * from "users" where "users"."name" ilike $1 limit $2) as "users"`
|
||||
expect(pg.queryMock).toHaveBeenCalledWith(expSql, ["John%", 5000])
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue