-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathmdx.test.ts
More file actions
36 lines (31 loc) · 1018 Bytes
/
mdx.test.ts
File metadata and controls
36 lines (31 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { describe, expect, it } from "vitest"
import remarkFrontmatter from "remark-frontmatter"
import { remarkMdxFrontmatter } from "remark-mdx-frontmatter"
import remarkGfm from "remark-gfm"
import rehypeHighlight from "rehype-highlight"
import { getMdxConfig, getMdxPluginNames } from "../src/mdx"
import { defaultConfig } from "../src/config"
describe("getMdxConfig", () => {
it("Test: getMdxConfig", async () => {
const result = await getMdxConfig(defaultConfig)
//console.log(result)
expect(result).toEqual({
remarkPlugins: [
remarkFrontmatter,
[remarkMdxFrontmatter, { name: "frontmatter" }],
remarkGfm,
],
rehypePlugins: [[rehypeHighlight, {}]],
})
})
})
describe("getMdxPluginNames", () => {
it("Test: getMdxPluginNames", () => {
const result = getMdxPluginNames([
remarkFrontmatter,
[remarkMdxFrontmatter],
])
//console.log(result)
expect(result).toEqual(["remarkFrontmatter", "remarkMdxFrontmatter"])
})
})