import { spawnSync } from "node:child_process"; import { pathToFileURL } from "node:url"; import { describe, expect, it } from "vitest"; describe("font catalog Node import", () => { it("loads under Node without a missing JSON import attribute", () => { const moduleUrl = pathToFileURL( new URL("./font-catalog.ts", import.meta.url).pathname, ).href; const result = spawnSync( process.execPath, [ "--experimental-strip-types", "--input-type=module", "--eval", `await import(${JSON.stringify(moduleUrl)})`, ], { encoding: "utf8" }, ); expect(result.status, result.stderr).toBe(0); }); });