timjroberts / cucumber-js-tsflow

Provides 'specflow' like bindings for Cucumber.js in TypeScript 1.7+.
MIT License
133 stars 34 forks source link

@Then decorator accept a bit different types than other #124

Closed hetacz closed 1 year ago

hetacz commented 1 year ago

@Given and @When both have such signature:

export declare function given(stepPattern: RegExp | string, tagOrOption?: string | StepOptions, timeout?: number): MethodDecorator;

while @then accepts tagOrOptions only as a string

export declare function then(stepPattern: RegExp | string, tagOrOption?: string, timeout?: number): MethodDecorator;

Therefore can write

@given('given step', {timeout: 10_000})

but not

@then('then step', {timeout:10_000})

insted one must write

@then('then step', '', 30_000)
Fryuni commented 1 year ago

That is indeed incorrect. All of them should have the same signature.

Thanks