Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Allow ExpressionsGroup.children to be optional ([#43](https://github.com/cucumber/javascript-core/pull/43))

## [0.8.2] - 2026-01-12
### Changed
Expand Down
18 changes: 6 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@cucumber/tag-expressions": "*"
},
"devDependencies": {
"@cucumber/cucumber-expressions": "^18.0.1",
"@cucumber/cucumber-expressions": "^19.0.0",
"@cucumber/gherkin": "^38.0.0",
"@cucumber/messages": "^32.0.0",
"@cucumber/query": "^15.0.0",
Expand Down
61 changes: 49 additions & 12 deletions src/makeTestPlan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,21 @@ describe('makeTestPlan', () => {
fn: sinon.stub(),
sourceReference: { uri: 'hooks.js', location: { line: 2, column: 1 } },
})
.parameterType({
name: 'flight',
regexp: /([A-Z]{3})-([A-Z]{3})/,
transformer: sinon.stub(),
sourceReference: { uri: 'hooks.js', location: { line: 1, column: 1 } },
})
.step({
pattern: 'we scored {int} out of {int}',
fn: sinon.stub(),
sourceReference: { uri: 'steps.js', location: { line: 1, column: 1 } },
sourceReference: { uri: 'steps.js', location: { line: 2, column: 1 } },
})
.step({
pattern: '{flight} has been delayed',
fn: sinon.stub(),
sourceReference: { uri: 'steps.js', location: { line: 3, column: 1 } },
})
.build()

Expand All @@ -572,31 +583,29 @@ describe('makeTestPlan', () => {
expect(result.toEnvelopes()).to.deep.eq([
{
testCase: {
id: '7',
pickleId: '3',
id: '11',
pickleId: '5',
testSteps: [
{
hookId: '4',
id: '8',
hookId: '6',
id: '12',
},
{
id: '9',
pickleStepId: '2',
stepDefinitionIds: ['6'],
id: '13',
pickleStepId: '3',
stepDefinitionIds: ['9'],
stepMatchArgumentsLists: [
{
stepMatchArguments: [
{
group: {
children: [],
start: 10,
value: '4',
},
parameterTypeName: 'int',
},
{
group: {
children: [],
start: 19,
value: '5',
},
Expand All @@ -607,8 +616,36 @@ describe('makeTestPlan', () => {
],
},
{
hookId: '5',
id: '10',
id: '14',
pickleStepId: '4',
stepDefinitionIds: ['10'],
stepMatchArgumentsLists: [
{
stepMatchArguments: [
{
group: {
children: [
{
start: 0,
value: 'LHR',
},
{
start: 4,
value: 'CDG',
},
],
start: 0,
value: 'LHR-CDG',
},
parameterTypeName: 'flight',
},
],
},
],
},
{
hookId: '7',
id: '15',
},
],
testRunStartedId,
Expand Down
6 changes: 6 additions & 0 deletions src/makeTestPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ function fromPickleSteps(
}

function mapArgumentGroup(group: ExpressionsGroup): MessagesGroup {
if (!group.children) {
return {
start: group.start,
value: group.value,
}
}
return {
start: group.start,
value: group.value,
Expand Down
3 changes: 2 additions & 1 deletion testdata/parameters.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Feature: a feature
Scenario: a scenario
Given we scored 4 out of 5
Given we scored 4 out of 5
And LHR-CDG has been delayed