Skip to content

Commit 7e274f3

Browse files
authored
test: add more module jsdoc tests (#2412)
1 parent 005369b commit 7e274f3

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

test/scripts/apidoc/__snapshots__/module.spec.ts.snap

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3+
exports[`module > analyzeModule() > ModuleDeprecationTest 1`] = `
4+
{
5+
"comment": "This is a description for a module with a code example.",
6+
"deprecated": "Well, this is deprecated.",
7+
"examples": undefined,
8+
}
9+
`;
10+
311
exports[`module > analyzeModule() > ModuleExampleTest 1`] = `
412
{
5-
"comment": "This is a description for a module with a code example",
13+
"comment": "This is a description for a module with a code example.",
614
"deprecated": undefined,
715
"examples": "<div class=\\"language-ts\\"><button title=\\"Copy Code\\" class=\\"copy\\"></button><span class=\\"lang\\">ts</span><pre v-pre class=\\"shiki material-theme-palenight\\"><code><span class=\\"line\\"><span style=\\"color:#89DDFF\\">new</span><span style=\\"color:#BABED8\\"> </span><span style=\\"color:#82AAFF\\">ModuleExampleTest</span><span style=\\"color:#BABED8\\">()</span></span></code></pre>
816
</div>",
@@ -27,10 +35,20 @@ and [api docs](/api/).",
2735
}
2836
`;
2937

38+
exports[`module > analyzeModule() > ModuleSimpleTest 1`] = `
39+
{
40+
"comment": "A simple module without anything special.",
41+
"deprecated": undefined,
42+
"examples": undefined,
43+
}
44+
`;
45+
3046
exports[`module > analyzeModule() > expected and actual modules are equal 1`] = `
3147
[
48+
"ModuleDeprecationTest",
3249
"ModuleExampleTest",
3350
"ModuleFakerJsLinkTest",
3451
"ModuleNextFakerJsLinkTest",
52+
"ModuleSimpleTest",
3553
]
3654
`;

test/scripts/apidoc/module.example.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* A simple module without anything special.
3+
*/
4+
export class ModuleSimpleTest {}
5+
16
/**
27
* Description with a link to our [website](https://fakerjs.dev/)
38
* and [api docs](https://fakerjs.dev/api/).
@@ -11,7 +16,14 @@ export class ModuleFakerJsLinkTest {}
1116
export class ModuleNextFakerJsLinkTest {}
1217

1318
/**
14-
* This is a description for a module with a code example
19+
* This is a description for a module with a code example.
20+
*
21+
* @deprecated Well, this is deprecated.
22+
*/
23+
export class ModuleDeprecationTest {}
24+
25+
/**
26+
* This is a description for a module with a code example.
1527
*
1628
* @example
1729
* new ModuleExampleTest()

0 commit comments

Comments
 (0)