From 79b3e5cc18dff5b213c5fb077e43af629025d9eb Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 8 Jun 2026 23:57:44 +0200 Subject: [PATCH] fix: narrow possibly undefined system in beszel test TypeScript reports 'system' is possibly undefined since it comes from array indexing. Replace expect().toBeDefined() with an explicit throw guard so the type narrows for subsequent property accesses. --- .../integrations/src/beszel/test/beszel-integration.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/integrations/src/beszel/test/beszel-integration.spec.ts b/packages/integrations/src/beszel/test/beszel-integration.spec.ts index c82fb86ad..a68e1dbc8 100644 --- a/packages/integrations/src/beszel/test/beszel-integration.spec.ts +++ b/packages/integrations/src/beszel/test/beszel-integration.spec.ts @@ -75,8 +75,10 @@ describe.skipIf(!shouldRun)("BeszelIntegration (real instance)", () => { test("each system has required fields", async () => { const systems = await integration.getSystemsAsync(); const system = systems[0]; - expect(system).toBeDefined(); - systemId = system?.id ?? ""; + if (!system) { + throw new Error("Expected at least one system"); + } + systemId = system.id; expect(system.id).toBeDefined(); expect(system.name).toBeDefined();