Skip to content

Commit be11cd8

Browse files
shufoczosel
authored andcommitted
test: 💍 extract doc on test
1 parent 70d5149 commit be11cd8

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

test/snapshot/__snapshots__/classconstant.test.js.snap

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ Program {
6767
"value": String {
6868
"isDoubleQuote": true,
6969
"kind": "string",
70+
"leadingComments": [
71+
CommentLine {
72+
"kind": "commentline",
73+
"offset": 165,
74+
"value": "// comment 4
75+
",
76+
},
77+
CommentLine {
78+
"kind": "commentline",
79+
"offset": 200,
80+
"value": "// comment 5
81+
",
82+
},
83+
],
7084
"raw": ""Hello world!"",
7185
"unicode": false,
7286
"value": "Hello world!",
@@ -75,9 +89,31 @@ Program {
7589
],
7690
"final": false,
7791
"kind": "classconstant",
92+
"leadingComments": [
93+
CommentLine {
94+
"kind": "commentline",
95+
"offset": 122,
96+
"value": "// comment 3
97+
",
98+
},
99+
],
78100
"nullable": false,
79101
"type": TypeReference {
80102
"kind": "typereference",
103+
"leadingComments": [
104+
CommentLine {
105+
"kind": "commentline",
106+
"offset": 41,
107+
"value": "// comment 1
108+
",
109+
},
110+
CommentLine {
111+
"kind": "commentline",
112+
"offset": 81,
113+
"value": "// comment 2
114+
",
115+
},
116+
],
81117
"name": "string",
82118
"raw": "string",
83119
},
@@ -97,6 +133,38 @@ Program {
97133
},
98134
},
99135
],
136+
"comments": [
137+
CommentLine {
138+
"kind": "commentline",
139+
"offset": 41,
140+
"value": "// comment 1
141+
",
142+
},
143+
CommentLine {
144+
"kind": "commentline",
145+
"offset": 81,
146+
"value": "// comment 2
147+
",
148+
},
149+
CommentLine {
150+
"kind": "commentline",
151+
"offset": 122,
152+
"value": "// comment 3
153+
",
154+
},
155+
CommentLine {
156+
"kind": "commentline",
157+
"offset": 165,
158+
"value": "// comment 4
159+
",
160+
},
161+
CommentLine {
162+
"kind": "commentline",
163+
"offset": 200,
164+
"value": "// comment 5
165+
",
166+
},
167+
],
100168
"errors": [],
101169
"kind": "program",
102170
}

test/snapshot/classconstant.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ describe("classconstant", () => {
8787
// comment 3
8888
CONSTANT
8989
// comment 4
90-
=
90+
=
9191
// comment 5
9292
"Hello world!";
9393
}`,
94-
{ parser: { version: 803 } },
94+
{ parser: { version: 803, extractDoc: true } },
9595
),
9696
).toMatchSnapshot();
9797
});

0 commit comments

Comments
 (0)