timjroberts / cucumber-js-tsflow

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

(\d*) is resolved to a string parameter rather than a number #104

Closed hurrikam closed 2 years ago

hurrikam commented 2 years ago

In Cucumber JS, the following step is a valid one:

When I pass in the number 10

with the step definition being:

When('I pass in the number (\d*)', function(value) { ...

In the absence of double quotes in the step declaration, the capture group (\d*) resolves to a number and so the value argument should be.

Strangely, cucumber-js-tsflow, resolves value to a string instead, even if the number 10 in the example is not enclosed in quotes. This is breaking the behaviour of existing test code when migrating from Cucumber JS to this package.

hurrikam commented 2 years ago

I'm closing the issue as we were able to go back to using Cucumber expressions.