Download src/agents/utils/syntax-highlight.test.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 644 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/utils/syntax-highlight.test.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/utils/syntax-highlight.test.ts
-
curl -L -o syntax-highlight.test.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/utils/syntax-highlight.test.ts
644 Bytes
| // Syntax highlight tests cover the lazy highlight.js integration and theme | |
| // callback rendering used by interactive output. | |
| import { describe, expect, it } from "vitest"; | |
| import { highlight, supportsLanguage } from "./syntax-highlight.js"; | |
| describe("syntax highlighting", () => { | |
| it("loads highlight.js through the package export and renders themed output", () => { | |
| expect(supportsLanguage("javascript")).toBe(true); | |
| const highlighted = highlight("const answer = 42;", { | |
| language: "javascript", | |
| theme: { | |
| keyword: (text) => `[${text}]`, | |
| }, | |
| }); | |
| expect(highlighted).toContain("[const]"); | |
| }); | |
| }); | |