Skip to content

Commit

Permalink
Do not discard context from substeps
Browse files Browse the repository at this point in the history
fixes #487
  • Loading branch information
wichert committed Jul 22, 2022
1 parent 5e176da commit 541c0b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion suite.go
Expand Up @@ -346,10 +346,12 @@ func (s *suite) maybeSubSteps(ctx context.Context, result interface{}) (context.
return ctx, fmt.Errorf("unexpected error, should have been []string: %T - %+v", result, result)
}

var err error

for _, text := range steps {
if def := s.matchStepText(text); def == nil {
return ctx, ErrUndefined
} else if ctx, err := s.maybeSubSteps(def.Run(ctx)); err != nil {
} else if ctx, err = s.maybeSubSteps(def.Run(ctx)); err != nil {
return ctx, fmt.Errorf("%s: %+v", text, err)
}
}
Expand Down

0 comments on commit 541c0b7

Please sign in to comment.