diff --git a/apps/t3/src/runtimeArchitecture.test.ts b/apps/t3/src/runtimeArchitecture.test.ts index c7fd239038..0e0688b231 100644 --- a/apps/t3/src/runtimeArchitecture.test.ts +++ b/apps/t3/src/runtimeArchitecture.test.ts @@ -2,6 +2,8 @@ import fs from "node:fs"; import path from "node:path"; import { describe, expect, it } from "vitest"; +const RUNTIME_SOURCE_FILES = ["cli.ts", "runtimeApiServer.ts"] as const; + describe("runtime architecture boundaries", () => { it("keeps runtime API server wired through runtime-core services", () => { const sourcePath = path.resolve(import.meta.dirname, "runtimeApiServer.ts"); @@ -13,12 +15,12 @@ describe("runtime architecture boundaries", () => { expect(source).toContain("TodoStore"); }); - it("avoids direct desktop service imports in runtime API server", () => { - const sourcePath = path.resolve(import.meta.dirname, "runtimeApiServer.ts"); - const source = fs.readFileSync(sourcePath, "utf8"); + for (const fileName of RUNTIME_SOURCE_FILES) { + it(`avoids direct desktop service imports in ${fileName}`, () => { + const sourcePath = path.resolve(import.meta.dirname, fileName); + const source = fs.readFileSync(sourcePath, "utf8"); - expect(source).not.toContain("../../desktop/src/processManager"); - expect(source).not.toContain("../../desktop/src/providerManager"); - expect(source).not.toContain("../../desktop/src/todoStore"); - }); + expect(source).not.toContain("../../desktop/src/"); + }); + } });