From 3f760be986f0b7962bf7640dba4f2ffbbbcff3f5 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Mon, 30 Nov 2026 02:38:36 -0600 Subject: [PATCH] test(wss): mock isAuditStreamEnabled in @dokploy/server mocks --- apps/dokploy/__test__/wss/docker-container-logs.test.ts | 1 + apps/dokploy/__test__/wss/docker-stats-overlap.test.ts | 1 + apps/dokploy/__test__/wss/docker-stats.test.ts | 1 + apps/dokploy/__test__/wss/listen-deployment.test.ts | 1 + apps/dokploy/__test__/wss/terminal-ssh-lifecycle.test.ts | 1 + 5 files changed, 5 insertions(+) diff --git a/apps/dokploy/__test__/wss/docker-container-logs.test.ts b/apps/dokploy/__test__/wss/docker-container-logs.test.ts index ab1f6e520..b0d2f56c8 100644 --- a/apps/dokploy/__test__/wss/docker-container-logs.test.ts +++ b/apps/dokploy/__test__/wss/docker-container-logs.test.ts @@ -6,6 +6,7 @@ import WebSocket from "ws"; const mockSpawn = vi.hoisted(() => vi.fn()); vi.mock("node-pty", () => ({ spawn: mockSpawn })); vi.mock("@dokploy/server", () => ({ + isAuditStreamEnabled: () => false, IS_CLOUD: false, findServerById: vi.fn(), validateRequest: vi.fn(async () => ({ diff --git a/apps/dokploy/__test__/wss/docker-stats-overlap.test.ts b/apps/dokploy/__test__/wss/docker-stats-overlap.test.ts index 8124a50aa..47764d37f 100644 --- a/apps/dokploy/__test__/wss/docker-stats-overlap.test.ts +++ b/apps/dokploy/__test__/wss/docker-stats-overlap.test.ts @@ -21,6 +21,7 @@ vi.mock("ws", () => ({ })); vi.mock("@dokploy/server", () => ({ + isAuditStreamEnabled: () => false, docker: { listContainers: mocks.listContainers }, execAsync: mocks.execAsync, getHostSystemStats: vi.fn(), diff --git a/apps/dokploy/__test__/wss/docker-stats.test.ts b/apps/dokploy/__test__/wss/docker-stats.test.ts index 856dcbdd6..64517754e 100644 --- a/apps/dokploy/__test__/wss/docker-stats.test.ts +++ b/apps/dokploy/__test__/wss/docker-stats.test.ts @@ -7,6 +7,7 @@ const mockValidateRequest = vi.hoisted(() => vi.fn()); const mockRecordAdvancedStats = vi.hoisted(() => vi.fn()); const mockListContainers = vi.hoisted(() => vi.fn(async () => [])); vi.mock("@dokploy/server", () => ({ + isAuditStreamEnabled: () => false, IS_CLOUD: false, docker: { listContainers: mockListContainers }, execAsync: vi.fn(), diff --git a/apps/dokploy/__test__/wss/listen-deployment.test.ts b/apps/dokploy/__test__/wss/listen-deployment.test.ts index 1cc279a8c..5090f1c9a 100644 --- a/apps/dokploy/__test__/wss/listen-deployment.test.ts +++ b/apps/dokploy/__test__/wss/listen-deployment.test.ts @@ -54,6 +54,7 @@ const mockFindServerById = vi.hoisted(() => vi.fn()); const mockFindDeploymentByLogPath = vi.hoisted(() => vi.fn()); const mockCheckServiceAccess = vi.hoisted(() => vi.fn()); vi.mock("@dokploy/server", () => ({ + isAuditStreamEnabled: () => false, IS_CLOUD: false, validateRequest: mockValidateRequest, findServerById: mockFindServerById, diff --git a/apps/dokploy/__test__/wss/terminal-ssh-lifecycle.test.ts b/apps/dokploy/__test__/wss/terminal-ssh-lifecycle.test.ts index 95f278856..a4e166bba 100644 --- a/apps/dokploy/__test__/wss/terminal-ssh-lifecycle.test.ts +++ b/apps/dokploy/__test__/wss/terminal-ssh-lifecycle.test.ts @@ -33,6 +33,7 @@ vi.mock("ssh2", async () => { vi.mock("node-pty", () => ({ spawn: vi.fn() })); vi.mock("public-ip", () => ({ publicIpv4: vi.fn(), publicIpv6: vi.fn() })); vi.mock("@dokploy/server", () => ({ + isAuditStreamEnabled: () => false, IS_CLOUD: false, execAsync: vi.fn(async () => ({ stdout: "", stderr: "" })), paths: vi.fn(() => ({ SSH_PATH: "/tmp" })),