fix: use file:// URL for dynamic imports in smoke test (Windows compat)

On Windows, raw paths like D:\... are interpreted as protocol "d:" by
the ESM loader. Convert via pathToFileURL before dynamic import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson 2026-03-16 11:46:04 -06:00
parent 40dd80a41e
commit d187a1ed2d

View file

@ -14,7 +14,7 @@
import test from "node:test";
import assert from "node:assert/strict";
import { join } from "node:path";
import { fileURLToPath } from "node:url";
import { fileURLToPath, pathToFileURL } from "node:url";
const projectRoot = join(fileURLToPath(import.meta.url), "..", "..", "..");
const extensionsDir = join(projectRoot, "src", "resources", "extensions");
@ -47,7 +47,7 @@ test("all bundled extensions can be imported without throwing", async () => {
}
try {
await import(entryPath);
await import(pathToFileURL(entryPath).href);
} catch (err) {
failures.push({
path: relPath,