Skip to content

Commit

Permalink
Use actual line of the step in cucumber formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Glib Briia committed Jan 26, 2024
1 parent 5a5631a commit 5a90497
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org).
This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com).

## Unreleased

- Remove line overwriting for scenario outlines in cucumber formatter ([599](https://github.com/cucumber/godog/pull/599) - [glibas](https://github.com/glibas))

## [v0.13.0]
### Added
- Support for reading feature files from an `fs.FS` ([550](https://github.com/cucumber/godog/pull/550) - [tigh-latte](https://github.com/tigh-latte))
Expand Down
4 changes: 2 additions & 2 deletions features/formatter/cucumber.feature
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Feature: cucumber json formatter
{
"keyword": "Given ",
"name": "passing step",
"line": 11,
"line": 7,
"match": {
"location": "suite_context.go:64"
},
Expand All @@ -345,7 +345,7 @@ Feature: cucumber json formatter
{
"keyword": "Given ",
"name": "failing step",
"line": 12,
"line": 7,
"match": {
"location": "suite_context.go:47"
},
Expand Down
4 changes: 0 additions & 4 deletions internal/formatters/fmt_cucumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ func (f *Cuke) buildCukeStep(pickle *messages.Pickle, stepResult models.PickleSt
step := feature.FindStep(pickleStep.AstNodeIds[0])

line := step.Location.Line
if len(pickle.AstNodeIds) == 2 {
_, row := feature.FindExample(pickle.AstNodeIds[1])
line = row.Location.Line
}

cukeStep.Name = pickleStep.Text
cukeStep.Line = int(line)
Expand Down

0 comments on commit 5a90497

Please sign in to comment.