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

support: add ability to name hooks #1994

Merged
merged 16 commits into from
Apr 20, 2022
Merged

support: add ability to name hooks #1994

merged 16 commits into from
Apr 20, 2022

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Apr 10, 2022

🤔 What's changed?

This PR adds support for named Before and After hooks via this backwards-compatible signature:

Before({name: 'setting stuff up'}, async function() {})

⚡️ What's your motivation?

Fixes cucumber/common#1079. Part of cucumber/messages#73

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Only implemented for Before/After and not BeforeAll/AfterAll or BeforeEach/AfterEach - since we don't expose those hooks in formatters there seemed little point in allowing users to supply a name that doesn't go anywhere, but I'm open to feedback there.

📋 Checklist:

  • Add support in html formatter before merging this (nice to have)
  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@davidjgoss davidjgoss changed the title Feat/named hooks feat(support): add ability to name hooks Apr 10, 2022
@davidjgoss davidjgoss changed the title feat(support): add ability to name hooks support: add ability to name hooks Apr 10, 2022
@coveralls
Copy link

coveralls commented Apr 10, 2022

Coverage Status

Coverage increased (+0.003%) to 98.238% when pulling 05a6317 on feat/named-hooks into dfb3f79 on main.

@davidjgoss davidjgoss marked this pull request as ready for review April 15, 2022 18:00
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

Successfully merging this pull request may close these issues.

3 participants