aboutsummaryrefslogtreecommitdiff
path: root/test/scripts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-09-22 09:44:19 +0200
committerGitHub <[email protected]>2023-09-22 09:44:19 +0200
commit7e274f3a0f42cb2c43f1e5bd1988b60c6a279fc5 (patch)
tree368f4f7a642d9d2ec483c6070542291726a3e4ac /test/scripts
parent005369b29c7ee290a870396ff0acc85e3f715e10 (diff)
downloadfaker-7e274f3a0f42cb2c43f1e5bd1988b60c6a279fc5.tar.xz
faker-7e274f3a0f42cb2c43f1e5bd1988b60c6a279fc5.zip
test: add more module jsdoc tests (#2412)
Diffstat (limited to 'test/scripts')
-rw-r--r--test/scripts/apidoc/__snapshots__/module.spec.ts.snap20
-rw-r--r--test/scripts/apidoc/module.example.ts14
2 files changed, 32 insertions, 2 deletions
diff --git a/test/scripts/apidoc/__snapshots__/module.spec.ts.snap b/test/scripts/apidoc/__snapshots__/module.spec.ts.snap
index a7a2ec01..3afdab63 100644
--- a/test/scripts/apidoc/__snapshots__/module.spec.ts.snap
+++ b/test/scripts/apidoc/__snapshots__/module.spec.ts.snap
@@ -1,8 +1,16 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+exports[`module > analyzeModule() > ModuleDeprecationTest 1`] = `
+{
+ "comment": "This is a description for a module with a code example.",
+ "deprecated": "Well, this is deprecated.",
+ "examples": undefined,
+}
+`;
+
exports[`module > analyzeModule() > ModuleExampleTest 1`] = `
{
- "comment": "This is a description for a module with a code example",
+ "comment": "This is a description for a module with a code example.",
"deprecated": undefined,
"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>
</div>",
@@ -27,10 +35,20 @@ and [api docs](/api/).",
}
`;
+exports[`module > analyzeModule() > ModuleSimpleTest 1`] = `
+{
+ "comment": "A simple module without anything special.",
+ "deprecated": undefined,
+ "examples": undefined,
+}
+`;
+
exports[`module > analyzeModule() > expected and actual modules are equal 1`] = `
[
+ "ModuleDeprecationTest",
"ModuleExampleTest",
"ModuleFakerJsLinkTest",
"ModuleNextFakerJsLinkTest",
+ "ModuleSimpleTest",
]
`;
diff --git a/test/scripts/apidoc/module.example.ts b/test/scripts/apidoc/module.example.ts
index 9671dc73..b3f43a86 100644
--- a/test/scripts/apidoc/module.example.ts
+++ b/test/scripts/apidoc/module.example.ts
@@ -1,4 +1,9 @@
/**
+ * A simple module without anything special.
+ */
+export class ModuleSimpleTest {}
+
+/**
* Description with a link to our [website](https://fakerjs.dev/)
* and [api docs](https://fakerjs.dev/api/).
*/
@@ -11,7 +16,14 @@ export class ModuleFakerJsLinkTest {}
export class ModuleNextFakerJsLinkTest {}
/**
- * This is a description for a module with a code example
+ * This is a description for a module with a code example.
+ *
+ * @deprecated Well, this is deprecated.
+ */
+export class ModuleDeprecationTest {}
+
+/**
+ * This is a description for a module with a code example.
*
* @example
* new ModuleExampleTest()