From 22450abc4b4a6633c7f3fd1922ac8c3862f2a905 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Fri, 28 Aug 2026 16:46:57 -0600 Subject: [PATCH] fix: satisfy HttpRouter type in traefik config test Test routers were missing the required "service" field, and mock.calls[0] destructuring failed under noUncheckedIndexedAccess. --- .../traefik/write-app-traefik-config.test.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts index 47142f2f9..90c1ba60a 100644 --- a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts +++ b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts @@ -60,7 +60,12 @@ describe("writeAppTraefikConfig", () => { await writeAppTraefikConfig( { http: { - routers: { [`${appName}-router-1`]: { rule: "Host(`x`)" } }, + routers: { + [`${appName}-router-1`]: { + rule: "Host(`x`)", + service: `${appName}-service`, + }, + }, services: {}, }, }, @@ -80,7 +85,7 @@ describe("writeAppTraefikConfig", () => { ); expect(mocks.execAsyncRemote).toHaveBeenCalledOnce(); - const [, command] = mocks.execAsyncRemote.mock.calls[0]; + const [, command] = mocks.execAsyncRemote.mock.calls[0] ?? []; expect(command).toMatch(/^rm -f /); expect(command).toContain("no-domain-app.yml"); }); @@ -91,7 +96,12 @@ describe("writeAppTraefikConfig", () => { await writeAppTraefikConfig( { http: { - routers: { "with-domain-app-router-1": { rule: "Host(`x`)" } }, + routers: { + "with-domain-app-router-1": { + rule: "Host(`x`)", + service: "with-domain-app-service", + }, + }, services: {}, }, }, @@ -100,7 +110,7 @@ describe("writeAppTraefikConfig", () => { ); expect(mocks.execAsyncRemote).toHaveBeenCalledOnce(); - const [, command] = mocks.execAsyncRemote.mock.calls[0]; + const [, command] = mocks.execAsyncRemote.mock.calls[0] ?? []; expect(command).toMatch(/^echo /); }); });