import { mkdtempSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { describe, expect, it } from "vitest"; import { compileForRender } from "./htmlCompiler.js"; const utf16le = (text: string) => Buffer.concat([Buffer.from([0xff, 0xfe]), Buffer.from(text, "utf16le")]); describe("compileForRender a page saved as UTF-16LE", () => { it("compiles its text, not NUL bytes, with its sub-composition", async () => { const projectDir = mkdtempSync(join(tmpdir(), "hf-compiler-utf16-")); writeFileSync( join(projectDir, "index.html"), utf16le(`