Skip to content

Commit 2fb04a4

Browse files
committed
add testcases
- ref. #1753
1 parent 7a0bf39 commit 2fb04a4

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

tests/line/__snapshots__/numberList.test.ts.snap

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3+
exports[`numberList > 1. with code 1`] = `
4+
[
5+
{
6+
"indent": 0,
7+
"nodes": [
8+
{
9+
"nodes": [],
10+
"number": 1,
11+
"raw": "1. ",
12+
"rawNumber": "1",
13+
"type": "numberList",
14+
},
15+
{
16+
"raw": "\`code\`",
17+
"text": "code",
18+
"type": "code",
19+
},
20+
],
21+
"type": "line",
22+
},
23+
]
24+
`;
25+
26+
exports[`numberList > 1. with decoration 1`] = `
27+
[
28+
{
29+
"indent": 0,
30+
"nodes": [
31+
{
32+
"nodes": [],
33+
"number": 1,
34+
"raw": "1. ",
35+
"rawNumber": "1",
36+
"type": "numberList",
37+
},
38+
{
39+
"decos": [
40+
"*-1",
41+
],
42+
"nodes": [
43+
{
44+
"raw": "deco",
45+
"text": "deco",
46+
"type": "plain",
47+
},
48+
],
49+
"raw": "[* deco]",
50+
"rawDecos": "*",
51+
"type": "decoration",
52+
},
53+
],
54+
"type": "line",
55+
},
56+
]
57+
`;
58+
359
exports[`numberList > 1. with no space is not numberList 1`] = `
460
[
561
{

tests/line/numberList.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ describe("numberList", () => {
1818
).toMatchSnapshot();
1919
});
2020

21+
it("1. with decoration", () => {
22+
expect(parse("1. [* deco]", { hasTitle: false })).toMatchSnapshot();
23+
});
24+
25+
it("1. with code", () => {
26+
expect(parse("1. `code`", { hasTitle: false })).toMatchSnapshot();
27+
});
28+
2129
it("1. with no space is not numberList", () => {
2230
expect(
2331
parse("1.not numberList", {

0 commit comments

Comments
 (0)