Skip to content

Commit b5029f4

Browse files
committed
fix tsdoc issues
1 parent a22b9a8 commit b5029f4

File tree

3 files changed

+29
-36
lines changed

3 files changed

+29
-36
lines changed

api-extractor.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"tsdocMessageReporting": {
2525
"tsdoc-undefined-tag": {
2626
"logLevel": "none"
27+
},
28+
"tsdoc-escape-greater-than": {
29+
"logLevel": "none"
2730
}
2831
}
2932
}

src/index.ts

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,20 @@ import { makeSourceReference } from './makeSourceReference.js'
22
import { builder } from './runner/state.js'
33
import { HookFunction, HookOptions, ParameterTypeOptions, StepFunction } from './types.js'
44

5-
/**
6-
* An implementation of Cucumber built around the Node.js test runner.
7-
*
8-
* @packageDocumentation
9-
*/
10-
115
export * from './DataTable.js'
126
export * from './types.js'
137

148
/**
159
* Define a custom parameter type for use in steps.
10+
* @public
1611
* @param options - define the behaviour of this parameter type
17-
* @example
18-
* ParameterType({
12+
* @example ParameterType(\{
1913
* name: 'flight',
20-
* regexp: /([A-Z]{3})-([A-Z]{3})/,
21-
* transformer(from, to) {
14+
* regexp: /([A-Z]\{3\})-([A-Z]\{3\})/,
15+
* transformer(from, to) \{
2216
* return new Flight(from, to)
23-
* },
24-
* })
17+
* \},
18+
* \})
2519
*/
2620
export function ParameterType(options: ParameterTypeOptions) {
2721
builder.registerParameterType(options, makeSourceReference())
@@ -31,21 +25,19 @@ export function ParameterType(options: ParameterTypeOptions) {
3125
* Define a hook that should be executed before Gherkin-derived steps in each test.
3226
* @public
3327
* @param fn - the function to be executed
34-
* @example
35-
* Before(async () => {
28+
* @example Before(async () => \{
3629
* // do stuff here
37-
* })
30+
* \})
3831
*/
3932
export function Before(fn: HookFunction): void
4033
/**
4134
* Define a hook that should be executed before Gherkin-derived steps in each test.
4235
* @public
4336
* @param options - declare more information about this hook
4437
* @param fn - the function to be executed
45-
* @example
46-
* Before({ name: 'Provision resources', tagFilter: '@uses-resources' }, async () => {
38+
* @example Before(\{ name: 'Provision resources', tagFilter: '\@uses-resources' \}, async () => \{
4739
* // do stuff here
48-
* })
40+
* \})
4941
*/
5042
export function Before(options: HookOptions, fn: HookFunction): void
5143
export function Before(arg1: HookFunction | HookOptions, arg2?: HookFunction) {
@@ -58,21 +50,19 @@ export function Before(arg1: HookFunction | HookOptions, arg2?: HookFunction) {
5850
* Define a hook that should be executed after Gherkin-derived steps in each test.
5951
* @public
6052
* @param fn - the function to be executed
61-
* @example
62-
* After(async () => {
53+
* @example After(async () => \{
6354
* // do stuff here
64-
* })
55+
* \})
6556
*/
6657
export function After(fn: HookFunction): void
6758
/**
6859
* Define a hook that should be executed after Gherkin-derived steps in each test.
6960
* @public
7061
* @param options - declare more information about this hook
7162
* @param fn - the function to be executed
72-
* @example
73-
* After({ name: 'Teardown resources', tagFilter: '@uses-resources' }, async () => {
63+
* @example After(\{ name: 'Teardown resources', tagFilter: '\@uses-resources' \}, async () => \{
7464
* // do stuff here
75-
* })
65+
* \})
7666
*/
7767
export function After(options: HookOptions, fn: HookFunction): void
7868
export function After(arg1: HookFunction | HookOptions, arg2?: HookFunction) {
@@ -83,38 +73,38 @@ export function After(arg1: HookFunction | HookOptions, arg2?: HookFunction) {
8373

8474
/**
8575
* Define a step to be used with the "Given" keyword
76+
* @public
8677
* @param text - a Cucumber Expression used to match the step with steps from Gherkin
8778
* @param fn - the function to be executed
88-
* @example
89-
* Given('I have {int} cukes in my belly', async (t, count) => {
79+
* @example Given('I have \{int\} cukes in my belly', async (t, count) => \{
9080
* // do stuff here
91-
* })
81+
* \})
9282
*/
9383
export function Given(text: string, fn: StepFunction) {
9484
builder.registerStep(text, fn, makeSourceReference())
9585
}
9686

9787
/**
9888
* Define a step to be used with the "When" keyword
89+
* @public
9990
* @param text - a Cucumber Expression used to match the step with steps from Gherkin
10091
* @param fn - the function to be executed
101-
* @example
102-
* When('I have {int} cukes in my belly', async (t, count) => {
92+
* @example When('I have \{int\} cukes in my belly', async (t, count) => \{
10393
* // do stuff here
104-
* })
94+
* \})
10595
*/
10696
export function When(text: string, fn: StepFunction) {
10797
builder.registerStep(text, fn, makeSourceReference())
10898
}
10999

110100
/**
111101
* Define a step to be used with the "Then" keyword
102+
* @public
112103
* @param text - a Cucumber Expression used to match the step with steps from Gherkin
113104
* @param fn - the function to be executed
114-
* @example
115-
* Then('I have {int} cukes in my belly', async (t, count) => {
105+
* @example Then('I have \{int\} cukes in my belly', async (t, count) => \{
116106
* // do stuff here
117-
* })
107+
* \})
118108
*/
119109
export function Then(text: string, fn: StepFunction) {
120110
builder.registerStep(text, fn, makeSourceReference())

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ export type TestCaseContext = {
5151
* Capture a "log" attachment.
5252
* @param text - the text to be logged
5353
* @remarks
54-
* A shorthand for {@link log} with a special media type.
54+
* A shorthand for {@link TestCaseContext.attach} with a special media type.
5555
*/
5656
log(text: string): Promise<void>
5757
/**
5858
* Capture a URL attachment.
5959
* @param url - the URL to be captured
6060
* @param title - the text title that should accompany the URL
6161
* @remarks
62-
* A shorthand for {@link log} with a special media type.
62+
* A shorthand for {@link TestCaseContext.attach} with a special media type.
6363
*/
6464
link(url: string, title?: string): Promise<void>
6565
/**
@@ -86,7 +86,7 @@ export type ParameterTypeOptions = {
8686
/**
8787
* A function for transforming the matched values to another object before passing to
8888
* the step function.
89-
* @param match
89+
* @param match - matched values from the regular expression
9090
* @remarks
9191
* If not provided, the raw matched value(s) will be passed to the step function.
9292
*/

0 commit comments

Comments
 (0)