Skip to content

Commit 20ddb08

Browse files
committed
fix: replace import.meta.resolve with direct path in mermaid test
import.meta.resolve is not supported in Vitest's module runner, causing CI to fail. Use a direct node_modules path to locate the astro-mermaid integration entry point instead.
1 parent 896b9f6 commit 20ddb08

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/mermaid-rendering.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ describe("Mermaid Rendering Validation", () => {
128128
// Verify the integration source contains the view transitions handler.
129129
// This is the key fix: the handler must be registered unconditionally
130130
// so that navigating from a page without diagrams to one with them works.
131-
const entrypoint = fileURLToPath(import.meta.resolve("astro-mermaid"));
131+
const entrypoint = join(
132+
ROOT,
133+
"node_modules",
134+
"astro-mermaid",
135+
"astro-mermaid-integration.js",
136+
);
132137
const content = readFileSync(entrypoint, "utf-8");
133138
expect(content).toContain("astro:after-swap");
134139
});

0 commit comments

Comments
 (0)