Skip to content

Commit

Permalink
PR-2091 Update the changelog. Using the same pattern of the compileRu…
Browse files Browse the repository at this point in the history
…le method as in Ruby.
  • Loading branch information
chaofan-nirvana committed Oct 8, 2022
1 parent 1816ce7 commit c2f80a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

### Fixed

* [Javascript] Fix compiling a rule with scenario outline of gherkin document is different from ruby's ([#2091](https://github.com/cucumber/common/pull/2091))
* [Python] Fix gherkin-python for compiling example values with trailing backslash ([#2048](https://github.com/cucumber/common/pull/2048), [#1954](https://github.com/cucumber/common/issues/1954))
* [PHP] Disallow installation of Messages `18.x` ([#2034](https://github.com/cucumber/common/pull/2034))

Expand Down
16 changes: 11 additions & 5 deletions gherkin/javascript/src/pickles/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,18 @@ function compileRule(
rule.children.forEach((stepsContainer) => {
if (stepsContainer.background) {
ruleBackgroundSteps = ruleBackgroundSteps.concat(stepsContainer.background.steps)
} else if (stepsContainer.scenario.examples.length === 0) {
compileScenario(
tags,
ruleBackgroundSteps,
stepsContainer.scenario,
language,
pickles,
uri,
newId
)
} else {
const compileFunc = stepsContainer.scenario.examples.length === 0
? compileScenario
: compileScenarioOutline

compileFunc(
compileScenarioOutline(
tags,
ruleBackgroundSteps,
stepsContainer.scenario,
Expand Down

0 comments on commit c2f80a3

Please sign in to comment.