From ff7120cf7aebde8419269f4edbe2a0b04605a41b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 1 Aug 2023 12:57:44 +0200 Subject: [PATCH] Fix types on tests --- packages/server/src/automations/tests/openai.spec.ts | 2 +- packages/server/src/migrations/tests/index.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/automations/tests/openai.spec.ts b/packages/server/src/automations/tests/openai.spec.ts index 31f7e48305..07ac73a7c8 100644 --- a/packages/server/src/automations/tests/openai.spec.ts +++ b/packages/server/src/automations/tests/openai.spec.ts @@ -68,7 +68,7 @@ describe("test the openai action", () => { }) it("should present the correct error message when an error is thrown from the createChatCompletion call", async () => { - openai.OpenAIApi.mockImplementation(() => ({ + ;(openai.OpenAIApi as any).mockImplementation(() => ({ createChatCompletion: jest.fn(() => { throw new Error("An error occurred while calling createChatCompletion") }), diff --git a/packages/server/src/migrations/tests/index.spec.ts b/packages/server/src/migrations/tests/index.spec.ts index b0fd971f42..2465c930b4 100644 --- a/packages/server/src/migrations/tests/index.spec.ts +++ b/packages/server/src/migrations/tests/index.spec.ts @@ -17,7 +17,7 @@ tk.freeze(timestamp) const clearMigrations = async () => { const dbs = [context.getDevAppDB(), context.getProdAppDB()] for (const db of dbs) { - const doc = await db.get(DocumentType.MIGRATIONS) + const doc = await db.get(DocumentType.MIGRATIONS) const newDoc = { _id: doc._id, _rev: doc._rev } await db.put(newDoc) } @@ -52,7 +52,7 @@ describe("migrations", () => { await config.createTable() await config.createView() await config.createTable() - await config.createView(structures.view(config.table._id)) + await config.createView(structures.view(config.table!._id!)) await config.createScreen() await config.createScreen()