test: enhance application tests with patch mock and additional paths

- Added a mock for the patch table in application.command.test.ts to simulate findMany behavior.
- Updated application.real.test.ts to include new paths for COMPOSE_PATH, SSH_PATH, and BASE_PATH for improved test coverage.
This commit is contained in:
Mauricio Siu
2026-02-18 14:51:28 -06:00
parent 5faa319b69
commit 97f9e8ad25
2 changed files with 6 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ vi.mock("@dokploy/server/db", () => {
applications: {
findFirst: vi.fn(),
},
patch: {
findMany: vi.fn().mockResolvedValue([]),
},
},
},
};

View File

@@ -13,7 +13,10 @@ vi.mock("@dokploy/server/constants", () => ({
paths: () => ({
LOGS_PATH: "/tmp/dokploy-test-real/logs",
APPLICATIONS_PATH: "/tmp/dokploy-test-real/applications",
COMPOSE_PATH: "/tmp/dokploy-test-real/compose",
SSH_PATH: "/tmp/dokploy-test-real/ssh",
PATCH_REPOS_PATH: "/tmp/dokploy-test-real/patch-repos",
BASE_PATH: "/tmp/dokploy-test-real",
}),
IS_CLOUD: false,
docker: {},