mirror of
https://github.com/quartz-community/alias-redirects.git
synced 2026-07-22 02:50:31 +00:00
22 lines
729 B
TypeScript
22 lines
729 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { unified } from "unified";
|
|
import remarkParse from "remark-parse";
|
|
import remarkStringify from "remark-stringify";
|
|
import { ExampleTransformer } from "../src/transformer";
|
|
import { createCtx } from "./helpers";
|
|
|
|
describe("ExampleTransformer", () => {
|
|
it("highlights text wrapped in the token", async () => {
|
|
const ctx = createCtx();
|
|
const transformer = ExampleTransformer({ highlightToken: "==" });
|
|
const plugins = transformer.markdownPlugins?.(ctx) ?? [];
|
|
|
|
const file = await unified()
|
|
.use(remarkParse)
|
|
.use(plugins)
|
|
.use(remarkStringify)
|
|
.process("Hello ==Quartz==");
|
|
|
|
expect(String(file)).toContain("**Quartz**");
|
|
});
|
|
});
|