-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathindex.test.mjs
More file actions
29 lines (28 loc) · 745 Bytes
/
index.test.mjs
File metadata and controls
29 lines (28 loc) · 745 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
import { remark } from "remark";
import remarkHtml from "remark-html";
import Plugin from "./index.mjs";
describe("customize blockquote", () => {
it("should transform W> into aside of warning", () => {
remark()
.use(Plugin, {
mapping: {
"W>": "warning",
},
})
.use(remarkHtml, {
sanitize: false,
})
.process(
`
W> hello world
`,
(err, { value: contents }) => {
expect(err).toBeUndefined();
expect(contents).toContain('<aside class="warning"');
expect(contents).toContain('<h6 class="warning__prefix"');
expect(contents).toContain("warning");
expect(contents).toMatchSnapshot();
},
);
});
});