-
Notifications
You must be signed in to change notification settings - Fork 0
/
markdown_test.ts
65 lines (56 loc) · 1.22 KB
/
markdown_test.ts
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import * as Md from "./markdown.ts";
import { assertEquals } from "https://deno.land/std@0.91.0/testing/asserts.ts";
Deno.test("Markdown children works for terminal", () => {
assertEquals(
Md.children("hello"),
["hello"],
);
});
Deno.test("Markdown children works for internal", () => {
assertEquals(
Md.children(["hello", "world"]),
["hello", "world"],
);
});
Deno.test("Markdown stringify", () => {
assertEquals(
Md.stringify(["hello", "world"]),
"helloworld",
);
});
Deno.test("Markdown em", () => {
assertEquals(
Md.stringify(Md.em("hello")),
"_hello_",
);
});
Deno.test("Markdown heading", () => {
assertEquals(
Md.stringify(Md.strong("hello")),
"**hello**",
);
});
Deno.test("Markdown heading", () => {
assertEquals(
Md.stringify(Md.heading("hello", 3)),
"### hello",
);
});
Deno.test("Markdown blocks", () => {
assertEquals(
Md.stringify(Md.blocks(["hello", "world"])),
"hello\n\nworld",
);
});
Deno.test("Markdown spans", () => {
assertEquals(
Md.stringify(Md.spans(["hello", "world"])),
"hello world",
);
});
Deno.test("Markdown html", () => {
assertEquals(
Md.stringify(Md.html("hello", "code")),
"<code>hello</code>",
);
});