Skip to content

Prepend context to parameter transformers#160

Merged
davidjgoss merged 13 commits into
mainfrom
prepend-context-to-parameter-type-transform
Nov 25, 2025
Merged

Prepend context to parameter transformers#160
davidjgoss merged 13 commits into
mainfrom
prepend-context-to-parameter-type-transform

Conversation

@davidjgoss
Copy link
Copy Markdown
Member

@davidjgoss davidjgoss commented Nov 25, 2025

🤔 What's changed?

Change the signature of parameter type transformer functions so the TestCaseContext is prepended as the first argument. This needs a bit of gymnastics with wrapping the function in order to achieve what we want within the constraints of the cucumber-expressions API.

At the same time, adopt the changes from cucumber/javascript-core#32 so we're doing a bit more of the lifting with the step arguments.

⚡️ What's your motivation?

Be consistent with step and hook functions (and the Node.js test runner itself) where we prepend the context as the first arg - enabling arrow functions by default - but still supply the world as this for continuity when coming from cucumber-js.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • 💥 Breaking change (incompatible changes to the API)

📋 Checklist:

  • 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 force-pushed the prepend-context-to-parameter-type-transform branch from 8976465 to ce7032d Compare November 25, 2025 19:10
@davidjgoss davidjgoss marked this pull request as ready for review November 25, 2025 19:51
@davidjgoss davidjgoss merged commit d26d144 into main Nov 25, 2025
8 checks passed
@davidjgoss davidjgoss deleted the prepend-context-to-parameter-type-transform branch November 25, 2025 19:51
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.

1 participant