cucumber-js-tsflow
cucumber-js-tsflow copied to clipboard
how to handle doc strings?
What's the correct syntax for retrieving a doc string parameter in the bound function? In plain Cucumber JS, the syntax I'm trying to use is shown here: https://github.com/cucumber/cucumber-js/blob/main/features/doc_string.feature.
Doc strings can be used without modifications with this library. It will be passed as a string after the last argument from the pattern.
Example:
Feature: Foo
Scenario: Bar
When I use a "parameter" with a doc string:
"""
Some text
"""
@binding()
class Steps {
@when('I use a {string} with a doc string:')
public paramWithDocString(param: string, docString?: string): void {
// Notice that the pattern guarantees that a string parameter will be given,
// but the doc string might be missing. It is up to the step function to handle that case.
// Usually, ending the step with a : is a good enough indicator that a doc string
// is expected.
}
}