Skip to content

Commit f449367

Browse files
authored
test(theme): use raw string serializer for markdown snapshots (#238)
1 parent d98b6a9 commit f449367

2 files changed

Lines changed: 274 additions & 2 deletions

File tree

‎tests/theme/theme.test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ test('TypeDoc Theme - Edge Cases Fixture', async t => {
4141

4242
rmSync(outputDir, { recursive: true, force: true });
4343

44-
t.assert.snapshot(actualMarkdown);
44+
t.assert.snapshot(actualMarkdown, { serializers: [val => val] });
4545
});
Lines changed: 273 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,275 @@
11
exports[`TypeDoc Theme - Edge Cases Fixture 1`] = `
2-
"# Class: \`webpack.js.org.ExamplesTest\`\\n\\nClass demonstrating the formatting of JSDoc example blocks.\\n\\n## Constructors\\n\\n### \`new ExamplesTest()\`\\n\\n* Returns: {ExamplesTest}\\n\\n## Methods\\n\\n### \`exampleMethod(name)\`\\n\\n* \`name\` {string} A simple string parameter\\n* Returns: {void} \\n\\nA sample method for the ExamplesTest class.\\n\`\`\`ts\\nexampleMethod('example-1');\\n\`\`\`\\n\\n\`\`\`ts\\nexampleMethod('example-2');\\n\`\`\`\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.IndexSignatureTest\`\\n\\nClass demonstrating indexSignature rendering.\\n\\n## Constructors\\n\\n### \`new IndexSignatureTest()\`\\n\\n* Returns: {IndexSignatureTest}\\n\\n## Properties\\n\\n* \`dictionaryProperty\` {{ [key: string]: number }} An object property to trigger indexSignature.\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.MemberGroupsTest\`\\n\\nClass demonstrating Implements and Constructor grouping.\\n\\n## Implements\\n\\n* {WebpackInterface}\\n\\n## Constructors\\n\\n### \`new MemberGroupsTest(data)\`\\n\\n* \`data\` {any} \\n* Returns: {MemberGroupsTest}\\n\\nThe constructor for MemberGroupsTest.\\n\\n## Lifecycle\\n\\n### \`init()\`\\n\\n* Returns: {void}\\n\\nA categorized method.\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.OverloadTest\`\\n\\nClass demonstrating overload signatures.\\n\\n## Constructors\\n\\n### \`new OverloadTest()\`\\n\\n* Returns: {OverloadTest}\\n\\n## Methods\\n\\n### \`overloadMethod(name, count)\`\\n\\n#### Call Signature\\n\\n* \`name\` {string} A simple string parameter\\n* \`count\` {number} A simple number parameter\\n* Returns: {void} \\n\\nFirst overload signature.\\n\\n#### Call Signature\\n\\n* \`isEnabled\` {boolean} A simple boolean parameter\\n* Returns: {string} \\n\\nSecond overload signature.\\n\\n#### Call Signature\\n\\n* \`id\` {number} A simple string parameter\\n* \`isEnabled\` {boolean} A simple boolean parameter\\n* Returns: {void} \\n\\nThird overload signature.\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.StabilityTest\`\\n\\nClass demonstrating stability for deprecated, experimental, and legacy APIs.\\n\\n## Constructors\\n\\n### \`new StabilityTest()\`\\n\\n* Returns: {StabilityTest}\\n\\n## Methods\\n\\n### \`deprecatedMethod()\`\\n\\n> Stability: 0 - Deprecated: Use the new API instead.\\n\\n* Returns: {void}\\n\\n***\\n\\n### \`experimentalMethod()\`\\n\\n> Stability: 1 - Experimental\\n\\n* Returns: {void}\\n\\n**\`Experimental\`**\\n\\n***\\n\\n### \`legacyMethod()\`\\n\\n> Stability: 3 - Legacy: This is a legacy Webpack v4 API.\\n\\n* Returns: {void}\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.TypedListTest\`\\n\\nClass demonstrating properties and typed lists.\\n\\n* Extends: {WebpackTest}\\n\\n## Constructors\\n\\n### \`new TypedListTest()\`\\n\\n* Returns: {TypedListTest}\\n\\n## Properties\\n\\n* \`typedListProperty\` {string} A sample property for the TypedListTest class.\\n\\n## Methods\\n\\n### \`typedListMethod(name, count)\`\\n\\n* \`name\` {string} The name of the instance\\n* \`count\` {number} The count of items\\n* Returns: {boolean} A boolean indicating success\\n\\nA sample method for the TypedListTest class.\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.WebpackInterface\`\\n\\n**\`Interface\`**\\n\\nInterface demonstrating Webpack as an interface.\\n\\n## Constructors\\n\\n### \`new WebpackInterface()\`\\n\\n* Returns: {WebpackInterface}\\n\\n\\n---\\n\\n# Class: \`webpack.js.org.WebpackTest\`\\n\\nClass demonstrating Webpack as a parent class.\\n\\n## Constructors\\n\\n### \`new WebpackTest()\`\\n\\n* Returns: {WebpackTest}\\n\\n\\n---\\n\\n# \`webpack\` Types\\n\\nThese types are not exported by webpack, but they are available to TypeScript consumers.\\n\\n## Type: \`ComplexArrayType\`\\n\\n* Type: {{ age: number; name: string }[]}\\n\\nComplex array type.\\n\\n### Type Declaration\\n\\n* \`age\` {number}\\n* \`name\` {string}\\n\\n***\\n\\n## Type: \`ComplexIntersectionType\`\\n\\n* Type: {{ id: string } & { metadata: object }}\\n\\nComplex intersection type.\\n\\n### Type Declaration\\n\\n* \`id\` {string}\\n\\n### Type Declaration\\n\\n* \`metadata\` {object}\\n\\n***\\n\\n## Type: \`ComplexUnionType\`\\n\\n* Type: {string | { advanced: boolean; timeout: number }}\\n\\nComplex union type.\\n\\n***\\n\\n## Type: \`SimpleArrayType\`\\n\\n* Type: {string[]}\\n\\nSimple array type.\\n\\n***\\n\\n## Type: \`SimpleIntersectionType\`\\n\\n* Type: {number & string}\\n\\nSimple intersection type.\\n\\n***\\n\\n## Type: \`SimpleUnionType\`\\n\\n* Type: {string | number}\\n\\nSimple union type.\\n"
2+
# Class: \`webpack.js.org.ExamplesTest\`
3+
4+
Class demonstrating the formatting of JSDoc example blocks.
5+
6+
## Constructors
7+
8+
### \`new ExamplesTest()\`
9+
10+
* Returns: {ExamplesTest}
11+
12+
## Methods
13+
14+
### \`exampleMethod(name)\`
15+
16+
* \`name\` {string} A simple string parameter
17+
* Returns: {void}
18+
19+
A sample method for the ExamplesTest class.
20+
\`\`\`ts
21+
exampleMethod('example-1');
22+
\`\`\`
23+
24+
\`\`\`ts
25+
exampleMethod('example-2');
26+
\`\`\`
27+
28+
29+
---
30+
31+
# Class: \`webpack.js.org.IndexSignatureTest\`
32+
33+
Class demonstrating indexSignature rendering.
34+
35+
## Constructors
36+
37+
### \`new IndexSignatureTest()\`
38+
39+
* Returns: {IndexSignatureTest}
40+
41+
## Properties
42+
43+
* \`dictionaryProperty\` {{ [key: string]: number }} An object property to trigger indexSignature.
44+
45+
46+
---
47+
48+
# Class: \`webpack.js.org.MemberGroupsTest\`
49+
50+
Class demonstrating Implements and Constructor grouping.
51+
52+
## Implements
53+
54+
* {WebpackInterface}
55+
56+
## Constructors
57+
58+
### \`new MemberGroupsTest(data)\`
59+
60+
* \`data\` {any}
61+
* Returns: {MemberGroupsTest}
62+
63+
The constructor for MemberGroupsTest.
64+
65+
## Lifecycle
66+
67+
### \`init()\`
68+
69+
* Returns: {void}
70+
71+
A categorized method.
72+
73+
74+
---
75+
76+
# Class: \`webpack.js.org.OverloadTest\`
77+
78+
Class demonstrating overload signatures.
79+
80+
## Constructors
81+
82+
### \`new OverloadTest()\`
83+
84+
* Returns: {OverloadTest}
85+
86+
## Methods
87+
88+
### \`overloadMethod(name, count)\`
89+
90+
#### Call Signature
91+
92+
* \`name\` {string} A simple string parameter
93+
* \`count\` {number} A simple number parameter
94+
* Returns: {void}
95+
96+
First overload signature.
97+
98+
#### Call Signature
99+
100+
* \`isEnabled\` {boolean} A simple boolean parameter
101+
* Returns: {string}
102+
103+
Second overload signature.
104+
105+
#### Call Signature
106+
107+
* \`id\` {number} A simple string parameter
108+
* \`isEnabled\` {boolean} A simple boolean parameter
109+
* Returns: {void}
110+
111+
Third overload signature.
112+
113+
114+
---
115+
116+
# Class: \`webpack.js.org.StabilityTest\`
117+
118+
Class demonstrating stability for deprecated, experimental, and legacy APIs.
119+
120+
## Constructors
121+
122+
### \`new StabilityTest()\`
123+
124+
* Returns: {StabilityTest}
125+
126+
## Methods
127+
128+
### \`deprecatedMethod()\`
129+
130+
> Stability: 0 - Deprecated: Use the new API instead.
131+
132+
* Returns: {void}
133+
134+
***
135+
136+
### \`experimentalMethod()\`
137+
138+
> Stability: 1 - Experimental
139+
140+
* Returns: {void}
141+
142+
**\`Experimental\`**
143+
144+
***
145+
146+
### \`legacyMethod()\`
147+
148+
> Stability: 3 - Legacy: This is a legacy Webpack v4 API.
149+
150+
* Returns: {void}
151+
152+
153+
---
154+
155+
# Class: \`webpack.js.org.TypedListTest\`
156+
157+
Class demonstrating properties and typed lists.
158+
159+
* Extends: {WebpackTest}
160+
161+
## Constructors
162+
163+
### \`new TypedListTest()\`
164+
165+
* Returns: {TypedListTest}
166+
167+
## Properties
168+
169+
* \`typedListProperty\` {string} A sample property for the TypedListTest class.
170+
171+
## Methods
172+
173+
### \`typedListMethod(name, count)\`
174+
175+
* \`name\` {string} The name of the instance
176+
* \`count\` {number} The count of items
177+
* Returns: {boolean} A boolean indicating success
178+
179+
A sample method for the TypedListTest class.
180+
181+
182+
---
183+
184+
# Class: \`webpack.js.org.WebpackInterface\`
185+
186+
**\`Interface\`**
187+
188+
Interface demonstrating Webpack as an interface.
189+
190+
## Constructors
191+
192+
### \`new WebpackInterface()\`
193+
194+
* Returns: {WebpackInterface}
195+
196+
197+
---
198+
199+
# Class: \`webpack.js.org.WebpackTest\`
200+
201+
Class demonstrating Webpack as a parent class.
202+
203+
## Constructors
204+
205+
### \`new WebpackTest()\`
206+
207+
* Returns: {WebpackTest}
208+
209+
210+
---
211+
212+
# \`webpack\` Types
213+
214+
These types are not exported by webpack, but they are available to TypeScript consumers.
215+
216+
## Type: \`ComplexArrayType\`
217+
218+
* Type: {{ age: number; name: string }[]}
219+
220+
Complex array type.
221+
222+
### Type Declaration
223+
224+
* \`age\` {number}
225+
* \`name\` {string}
226+
227+
***
228+
229+
## Type: \`ComplexIntersectionType\`
230+
231+
* Type: {{ id: string } & { metadata: object }}
232+
233+
Complex intersection type.
234+
235+
### Type Declaration
236+
237+
* \`id\` {string}
238+
239+
### Type Declaration
240+
241+
* \`metadata\` {object}
242+
243+
***
244+
245+
## Type: \`ComplexUnionType\`
246+
247+
* Type: {string | { advanced: boolean; timeout: number }}
248+
249+
Complex union type.
250+
251+
***
252+
253+
## Type: \`SimpleArrayType\`
254+
255+
* Type: {string[]}
256+
257+
Simple array type.
258+
259+
***
260+
261+
## Type: \`SimpleIntersectionType\`
262+
263+
* Type: {number & string}
264+
265+
Simple intersection type.
266+
267+
***
268+
269+
## Type: \`SimpleUnionType\`
270+
271+
* Type: {string | number}
272+
273+
Simple union type.
274+
3275
`;

0 commit comments

Comments
 (0)