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

Feature Requests: autoBindSteps should propose suitable code #167

Open
drpicox opened this issue Nov 19, 2022 · 2 comments
Open

Feature Requests: autoBindSteps should propose suitable code #167

drpicox opened this issue Nov 19, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@drpicox
Copy link

drpicox commented Nov 19, 2022

Currently, when we are using autoBindSteps, when a step is failing the output looks like:

    Scenario "List products with no products" has 2 step(s) in the feature file, but 0 step definition(s) defined. Try adding the following code:

    test('List products with no products', ({ when, then }) => {
    	when('I list products', () => {

    	});

    	then(/^there should be (\d+) products$/, (arg0) => {

    	});
    });

But when we are using autoBindSteps, we are not using jest test directly, so the suggestion is confusing.
It should be nice to change the message to something like:

    Scenario "List products with no products" has 2 step(s) in the feature file, but 0 step definition(s) defined. Try adding the following code:

    const listProductsWithNoProductsStep = ({ when, then }) => {
    	when('I list products', () => {

    	});

    	then(/^there should be (\d+) products$/, (arg0) => {

    	});
    });

Thanks and awesome job!

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Mar 28, 2024
@pplancq
Copy link
Contributor

pplancq commented Mar 28, 2024

Your proposal is interesting, and indeed when using autoBindSteps the error message can be confusing.

@bencompton Can you tag this issue in enhancement?

@bencompton bencompton added bug Something isn't working enhancement New feature or request and removed Stale bug Something isn't working labels Mar 28, 2024
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