From c6b9d99c3b42b4f7ff172a9060e7222d30506121 Mon Sep 17 00:00:00 2001 From: kevin9327 <5299031+kevin9327@users.noreply.github.com> Date: Sun, 6 Sep 2026 07:13:51 +0900 Subject: [PATCH] Read the example package by a path the host accepts, not a URL pathname --- app/tests/skill-creator-slug.test.ts | 5 ++++- server/tests/tenant-package.test.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/tests/skill-creator-slug.test.ts b/app/tests/skill-creator-slug.test.ts index a67460f54..fa4f790b6 100644 --- a/app/tests/skill-creator-slug.test.ts +++ b/app/tests/skill-creator-slug.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "bun:test"; import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; import { parse } from "yaml"; import { SKILL_CREATOR_SLUG } from "@/lib/skills/proposal"; @@ -15,7 +16,9 @@ import { SKILL_CREATOR_SLUG } from "@/lib/skills/proposal"; * Read from the file rather than from a fixture, because the file is what ships. */ -const packageDir = new URL("../../examples/fintech", import.meta.url).pathname; +const packageDir = fileURLToPath( + new URL("../../examples/fintech", import.meta.url), +); const shipped = parse(readFileSync(`${packageDir}/skills.yaml`, "utf8")) as { skills: { slug: string; title: string; instructions: string }[]; diff --git a/server/tests/tenant-package.test.ts b/server/tests/tenant-package.test.ts index d0ab517f1..819eb5556 100644 --- a/server/tests/tenant-package.test.ts +++ b/server/tests/tenant-package.test.ts @@ -1,5 +1,6 @@ import { afterAll, afterEach, describe, expect, test } from "bun:test"; import { randomUUID } from "node:crypto"; +import { fileURLToPath } from "node:url"; import { and, eq } from "drizzle-orm"; import { createDatabase } from "../src/db/client"; import { @@ -288,7 +289,7 @@ describe("tenant YAML validation", () => { test("loads the mounted fintech package without a theme file", async () => { const tenantPackage = await loadTenantPackage( - new URL("../../examples/fintech", import.meta.url).pathname, + fileURLToPath(new URL("../../examples/fintech", import.meta.url)), ); expect(tenantPackage.tenantId).toBe("openbot");