Skip to content

Commit 1973dda

Browse files
authored
Merge branch 'next' into 1686-padding-line-between-statements
2 parents 46249fe + e296ff2 commit 1973dda

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

scripts/apidoc/signature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function analyzeParameterOptions(
246246
description: mdToHtml(
247247
toBlock(
248248
property.comment ??
249-
(property.type as ReflectionType)?.declaration.signatures?.[0]
249+
(property.type as ReflectionType)?.declaration?.signatures?.[0]
250250
.comment
251251
)
252252
),

src/modules/helpers/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ export class HelpersModule {
408408
/**
409409
* Returns a random key from given object or `undefined` if no key could be found.
410410
*
411+
* @template T The type of the object to select from.
411412
* @param object The object to be used.
412413
*
413414
* @example
@@ -423,6 +424,7 @@ export class HelpersModule {
423424
/**
424425
* Returns a random value from given object or `undefined` if no key could be found.
425426
*
427+
* @template T The type of object to select from.
426428
* @param object The object to be used.
427429
*
428430
* @example
@@ -801,6 +803,7 @@ export class HelpersModule {
801803
/**
802804
* Generates an array containing values returned by the given method.
803805
*
806+
* @template T The type of elements.
804807
* @param method The method used to generate the values.
805808
* @param options The optional options object.
806809
* @param options.count The number or range of elements to generate. Defaults to `3`.

test/scripts/apidoc/examplesAndDeprecations.spec.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@ import { resolve } from 'node:path';
33
import type { DeclarationReflection, SignatureReflection } from 'typedoc';
44
import { ReflectionKind } from 'typedoc';
55
import type { SpyInstance } from 'vitest';
6-
import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest';
6+
import {
7+
afterAll,
8+
beforeAll,
9+
beforeEach,
10+
describe,
11+
expect,
12+
it,
13+
vi,
14+
} from 'vitest';
715
import { selectApiModules } from '../../../scripts/apidoc/moduleMethods';
16+
import {
17+
analyzeSignature,
18+
initMarkdownRenderer,
19+
} from '../../../scripts/apidoc/signature';
820
import {
921
extractRawExamples,
1022
extractSeeAlsos,
@@ -27,6 +39,8 @@ const locales: Record<string, string> = {
2739
DE: 'de',
2840
};
2941

42+
beforeAll(initMarkdownRenderer);
43+
3044
describe('examples and deprecations', () => {
3145
const project = loadProject();
3246

@@ -107,6 +121,18 @@ describe('examples and deprecations', () => {
107121
}
108122
}
109123

124+
// Verify @param tags
125+
analyzeSignature(signature, moduleName, methodName).parameters.forEach(
126+
(param) => {
127+
const { name, description } = param;
128+
const plainDescription = description.replace(/<[^>]+>/g, '').trim();
129+
expect(
130+
plainDescription,
131+
`Expect param ${name} to have a description`
132+
).not.toBe('Missing');
133+
}
134+
);
135+
110136
// Verify @see tag
111137
extractSeeAlsos(signature).forEach((link) => {
112138
if (link.startsWith('faker.')) {

0 commit comments

Comments
 (0)