Skip to content

Commit f5de7bd

Browse files
ebuildyclaude
andcommitted
fix: don't statically resolve dist/ in packaging test (breaks CI typecheck)
The plugin-default-export packaging test imported "../dist/index.js" as a string literal, so `tsc --noEmit` tried to resolve it — failing the typecheck CI step, which runs before `dist/` is built. Import via a runtime URL instead; behavior is unchanged and the file exists during `npm run test`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a19339d commit f5de7bd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/packaging.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ describe("packaging: ESM-only", () => {
4545

4646
describe("packaging: plugin default export", () => {
4747
it("exposes a Docusaurus plugin as the package default export", async () => {
48-
const mod = await import("../dist/index.js");
48+
// Import the built artifact via a runtime URL so `tsc --noEmit` doesn't try to
49+
// resolve `dist/` (which isn't built during the typecheck CI step). `npm run
50+
// test` builds the package first, so the file exists at runtime.
51+
const entry = new URL("../dist/index.js", import.meta.url).href;
52+
const mod = (await import(entry)) as {
53+
default: (context: unknown, options: unknown) => { name: string };
54+
};
4955
expect(typeof mod.default).toBe("function");
5056
const plugin = mod.default({}, { host: "https://gitlab.example.com", cache: false });
5157
expect(plugin.name).toBe("@ebuildy/docusaurus-plugin-gitlab");

0 commit comments

Comments
 (0)