Skip to content

Add details to "step is undefined" error#669

Merged
vearutop merged 2 commits intomainfrom
undefined-details
Dec 10, 2024
Merged

Add details to "step is undefined" error#669
vearutop merged 2 commits intomainfrom
undefined-details

Conversation

@vearutop
Copy link
Copy Markdown
Member

@vearutop vearutop commented Dec 10, 2024

🤔 What's changed?

Step text is added to the wrapped error and can help to identify the problematic step.

=== RUN   TestAPISuiteRun/Foo
    suite.go:634: step is undefined: I should have "foo" responssssse with body

⚡️ What's your motivation?

Currently, the error returned for an undefined step lacks details and relies on formatter context to be actionable

=== RUN   TestAPISuiteRun/Foo
    suite.go:634: step is undefined

This makes it hard to understand which exact step is the issue.

🏷️ What kind of change is this?

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

♻️ Anything particular you want feedback on?

No.

📋 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.

@github-actions
Copy link
Copy Markdown

Go API Changes

# github.com/cucumber/godog/formatters
## compatible changes
FlushFormatter: added

# summary
Inferred base version: v0.15.0
Suggested version: v0.16.0

@vearutop vearutop marked this pull request as ready for review December 10, 2024 14:32
Copy link
Copy Markdown

@ahmedaabouzied ahmedaabouzied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vearutop vearutop merged commit e55eab6 into main Dec 10, 2024
@vearutop vearutop deleted the undefined-details branch December 10, 2024 15:54
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.

2 participants