Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rowsHash() #3

Open
mjstelly opened this issue Apr 26, 2018 · 2 comments
Open

Add support for rowsHash() #3

mjstelly opened this issue Apr 26, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@mjstelly
Copy link

mjstelly commented Apr 26, 2018

Cucumber's rowsHash() function transforms a data table into a JSON object. To maintain parity between cucumber and jest, it would be helpful for jest-cucumber to support that function. Currently, I have to hack a non-standard data table structure in my feature file from this

| firstName | Sara |
| lastName | Lee |

to this

| key | value |
| firstName | Sara |
| lastName | Lee |

and then transform it in the step:

    when('Sara provides account information:', userInfo => {
      const user = {};
      userInfo.forEach(({ key, value }) => (user[key] = value));
      userStore.updateUser(user);
    });

Although this way does the job, it is "non-canon". Folks familiar with cucumber won't understand why we didn't use rowsHash() instead.

@bencompton bencompton added the enhancement New feature or request label Apr 27, 2018
@bencompton
Copy link
Owner

Sure, more idiomatic table handling would be nice. Thanks for bringing this to light.

@manu1rock
Copy link

Hello, this PBI is added but still shows in backlog. Is there any plan to include this? It would be helpful if this can be prioritized.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants