mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 10:06:21 +00:00
feat(cli): stamp font compiler version in localized HTML
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { runFontLocalize, type FontLocalizeIo } from "./fontLocalize.js";
|
||||
import { runFontLocalize, stampFontCompilerVersion, type FontLocalizeIo } from "./fontLocalize.js";
|
||||
|
||||
function makeIo(input: string): {
|
||||
io: FontLocalizeIo;
|
||||
@@ -70,3 +70,17 @@ describe("runFontLocalize", () => {
|
||||
expect(harness.errors.join(" ")).toContain("empty output");
|
||||
});
|
||||
});
|
||||
|
||||
describe("stampFontCompilerVersion", () => {
|
||||
it("records the compiler version inside the document head", () => {
|
||||
const stamped = stampFontCompilerVersion(
|
||||
"<!doctype html><html><head><title>x</title></head><body></body></html>",
|
||||
"0.8.15",
|
||||
);
|
||||
|
||||
expect(stamped).toContain('<meta name="hyperframes-font-compiler-version" content="0.8.15">');
|
||||
expect(stamped.indexOf("hyperframes-font-compiler-version")).toBeLessThan(
|
||||
stamped.indexOf("</head>"),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user