From a27be54b691336f7edcd128fc2b2e7466f2035ef Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Sep 2024 22:38:45 +0100 Subject: [PATCH] make mocks async --- .../worker/src/api/controllers/global/tests/configs.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/worker/src/api/controllers/global/tests/configs.spec.ts b/packages/worker/src/api/controllers/global/tests/configs.spec.ts index ad9efc4398..3ff6a5298c 100644 --- a/packages/worker/src/api/controllers/global/tests/configs.spec.ts +++ b/packages/worker/src/api/controllers/global/tests/configs.spec.ts @@ -38,7 +38,7 @@ describe("Global configs controller", () => { it("Should return the default BB AI config when the feature is turned on", async () => { jest .spyOn(pro.features, "isBudibaseAIEnabled") - .mockImplementation(() => true) + .mockImplementation(() => Promise.resolve(true)) const data = structures.configs.ai() await config.api.configs.saveConfig(data) const response = await config.api.configs.getAIConfig() @@ -66,7 +66,7 @@ describe("Global configs controller", () => { it("Should not not return the default Budibase AI config when on self host", async () => { jest .spyOn(pro.features, "isBudibaseAIEnabled") - .mockImplementation(() => false) + .mockImplementation(() => Promise.resolve(false)) const data = structures.configs.ai() await config.api.configs.saveConfig(data) const response = await config.api.configs.getAIConfig()