mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
test(highlightjs): ensure language registration works
This commit is contained in:
parent
b6557d2a42
commit
fd52b9ec4b
@ -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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user