check postgres has been called
This commit is contained in:
parent
cdc55a0c32
commit
8e480ac884
|
@ -1,3 +1,4 @@
|
||||||
|
const pg = require("pg")
|
||||||
jest.mock("pg")
|
jest.mock("pg")
|
||||||
import * as setup from "./utilities"
|
import * as setup from "./utilities"
|
||||||
import { mocks } from "@budibase/backend-core/tests"
|
import { mocks } from "@budibase/backend-core/tests"
|
||||||
|
@ -126,6 +127,7 @@ describe("/api/env/variables", () => {
|
||||||
a: "string",
|
a: "string",
|
||||||
b: "number",
|
b: "number",
|
||||||
})
|
})
|
||||||
|
expect(pg.queryMock).toHaveBeenCalled()
|
||||||
expect(res.body.rows.length).toEqual(1)
|
expect(res.body.rows.length).toEqual(1)
|
||||||
expect(events.query.previewed).toBeCalledTimes(1)
|
expect(events.query.previewed).toBeCalledTimes(1)
|
||||||
expect(events.query.previewed).toBeCalledWith(
|
expect(events.query.previewed).toBeCalledWith(
|
||||||
|
|
Loading…
Reference in New Issue