From f77a67ba33758f178761810be7fc4e20391f8bed Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sat, 29 Nov 2025 00:47:31 -0600 Subject: [PATCH] refactor: improve type safety in application command test mock - Updated the type definition for the createChainableMock function to enhance type safety. - Ensured that the returning method in the mock returns a properly typed value. --- apps/dokploy/__test__/deploy/application.command.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/dokploy/__test__/deploy/application.command.test.ts b/apps/dokploy/__test__/deploy/application.command.test.ts index 7bfa93ac8..a0c4387c8 100644 --- a/apps/dokploy/__test__/deploy/application.command.test.ts +++ b/apps/dokploy/__test__/deploy/application.command.test.ts @@ -3,19 +3,18 @@ import * as applicationService from "@dokploy/server/services/application"; import { deployApplication } from "@dokploy/server/services/application"; import * as deploymentService from "@dokploy/server/services/deployment"; import * as builders from "@dokploy/server/utils/builders"; -import * as errorNotifications from "@dokploy/server/utils/notifications/build-error"; import * as notifications from "@dokploy/server/utils/notifications/build-success"; import * as execProcess from "@dokploy/server/utils/process/execAsync"; import * as gitProvider from "@dokploy/server/utils/providers/git"; import { beforeEach, describe, expect, it, vi } from "vitest"; vi.mock("@dokploy/server/db", () => { - const createChainableMock = () => { + const createChainableMock = (): any => { const chain = { set: vi.fn(() => chain), where: vi.fn(() => chain), - returning: vi.fn().mockResolvedValue([{}]), - }; + returning: vi.fn().mockResolvedValue([{}] as any), + } as any; return chain; };