From 8e480ac88471c2096b62f95bb7cee633f7fb685d Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 3 Feb 2023 09:19:27 +0000 Subject: [PATCH] check postgres has been called --- .../server/src/api/routes/tests/environmentVariables.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/src/api/routes/tests/environmentVariables.spec.ts b/packages/server/src/api/routes/tests/environmentVariables.spec.ts index b09d6d2365..50304a812e 100644 --- a/packages/server/src/api/routes/tests/environmentVariables.spec.ts +++ b/packages/server/src/api/routes/tests/environmentVariables.spec.ts @@ -1,3 +1,4 @@ +const pg = require("pg") jest.mock("pg") import * as setup from "./utilities" import { mocks } from "@budibase/backend-core/tests" @@ -126,6 +127,7 @@ describe("/api/env/variables", () => { a: "string", b: "number", }) + expect(pg.queryMock).toHaveBeenCalled() expect(res.body.rows.length).toEqual(1) expect(events.query.previewed).toBeCalledTimes(1) expect(events.query.previewed).toBeCalledWith(