import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
const currentDir = dirname(fileURLToPath(import.meta.url));
const srcDir = resolve(currentDir, "..");
describe("memory route wiring", () => {
    it("mounts the authenticated memory list route under /runtime", () => {
        const routeSource = readFileSync(resolve(currentDir, "./memory.ts"), "utf-8");
        const indexSource = readFileSync(resolve(srcDir, "./index.ts"), "utf-8");
        expect(routeSource).toMatch(/memoryRouter\.post\(\s*"\/memory\/list",\s*validateToken/);
        expect(indexSource).toContain('import { memoryRouter } from "./routes/memory.js";');
        expect(indexSource).toContain('app.use("/runtime", memoryRouter);');
    });
});
