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

Hooks marked as "skipped" flag the entire scenario as skipped #2467

Open
tristanzander opened this issue Feb 5, 2025 · 0 comments
Open

Hooks marked as "skipped" flag the entire scenario as skipped #2467

tristanzander opened this issue Feb 5, 2025 · 0 comments

Comments

@tristanzander
Copy link
Contributor

tristanzander commented Feb 5, 2025

👓 What did you see?

I recently went to mark a hook as "skipped" when it performed no function so that we knew when they did/didn't run. I discovered that Cucumber marks the entire Scenario as skipped even if only the hooks are skipped, and that felt a bit strange. Is this the intended behavior?

✅ What did you expect to see?

When running a hook that reports as "skipped", I would expect the result of the Given/When/Then executions to mark the status of the scenario as success.

📦 Which tool/library version are you using?

node v22.6.0
cucumber v11.2 and v10.9

🔬 How could we reproduce it?

// testing.js
const { When, After } = require('@cucumber/cucumber');

When('I do a thing', function () {});

After(function () {
	return 'skipped';
});
# testing.feature
Feature: Testing Cucumber Behaviors

    Scenario: Test
        When I do a thing

Output:

$ npx cucumber-js -r ./testing.js ./testing.feature
.-

1 scenario (1 skipped)
1 step (1 passed)
0m00.005s (executing steps: 0m00.000s)

📚 Any additional context?

No response

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

No branches or pull requests

1 participant