test(highlightjs): ensure language registration works

This commit is contained in:
Elian Doran 2025-05-18 14:23:10 +03:00
parent b6557d2a42
commit fd52b9ec4b
No known key found for this signature in database

View File

@ -1,5 +1,6 @@
import { describe, it } from "vitest"; import { describe, it } from "vitest";
import definitions from "./syntax_highlighting.js"; import definitions from "./syntax_highlighting.js";
import hljs from "highlight.js";
describe("Syntax highlighting definitions", () => { describe("Syntax highlighting definitions", () => {
it("every entry is readable", async () => { it("every entry is readable", async () => {
@ -8,7 +9,12 @@ describe("Syntax highlighting definitions", () => {
continue; continue;
} }
await mapping.loader; const language = (await mapping.loader).default;
hljs.registerLanguage(mime, language);
hljs.highlight("Hello world", {
language: mime
});
} }
}); });
}); });