Skip to content

Commit 2028828

Browse files
authored
Skip undefined steps in after scenario hooks (#494)
1 parent fd5b6a1 commit 2028828

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
1414
### Fixed
1515
- Fixed a bug which would ignore the context returned from a substep.([488](https://github.com/cucumber/godog/pull/488) - [wichert](https://github.com/wichert))
1616
- Fixed a bug which would cause a panic when using the pretty formatter with a feature that contained a rule. ([480](https://github.com/cucumber/godog/pull/480) - [dumpsterfireproject](https://github.com/dumpsterfireproject))
17+
- Multiple invocations of AfterScenario hooks in case of undefined steps. ([494](https://github.com/cucumber/godog/pull/494) - [vearutop](https://github.com/vearutop))
1718

1819
### Deprecated
1920
- `godog` CLI tool prints deprecation warning. ([489](https://github.com/cucumber/godog/pull/489) - [vearutop](https://github.com/vearutop))

suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (s *suite) runStep(ctx context.Context, pickle *Scenario, step *Step, prevS
9999
rctx, err = s.runAfterStepHooks(ctx, step, sr.Status, err)
100100

101101
// Trigger after scenario on failing or last step to attach possible hook error to step.
102-
if sr.Status != StepSkipped && ((err == nil && isLast) || err != nil) {
102+
if isLast || (sr.Status != StepSkipped && sr.Status != StepUndefined && err != nil) {
103103
rctx, err = s.runAfterScenarioHooks(rctx, pickle, err)
104104
}
105105

0 commit comments

Comments
 (0)