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 e6e976c commit 7d465fa
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 @@ -23,6 +23,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 7d465fa

Please sign in to comment.