diff --git a/gherkin/CHANGELOG.md b/gherkin/CHANGELOG.md index fda886fa474..d4b622fa71e 100644 --- a/gherkin/CHANGELOG.md +++ b/gherkin/CHANGELOG.md @@ -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)) diff --git a/gherkin/javascript/src/pickles/compile.ts b/gherkin/javascript/src/pickles/compile.ts index b8180107b43..bca0985f68d 100644 --- a/gherkin/javascript/src/pickles/compile.ts +++ b/gherkin/javascript/src/pickles/compile.ts @@ -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,