@@ -2,26 +2,20 @@ import { makeSourceReference } from './makeSourceReference.js'
22import { builder } from './runner/state.js'
33import { 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-
115export * from './DataTable.js'
126export * 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 */
2620export 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 */
3932export 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 */
5042export function Before ( options : HookOptions , fn : HookFunction ) : void
5143export 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 */
6657export 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 */
7767export function After ( options : HookOptions , fn : HookFunction ) : void
7868export 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 */
9383export 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 */
10696export 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 */
119109export function Then ( text : string , fn : StepFunction ) {
120110 builder . registerStep ( text , fn , makeSourceReference ( ) )
0 commit comments