diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a17df9..a09c05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] +### Added +- Include `pickleId` in `AssembledTestCase` ([#26](https://github.com/cucumber/javascript-core/pull/26)) ## [0.5.1] - 2025-09-17 diff --git a/cucumber-core.api.md b/cucumber-core.api.md index a433a84..8b96c5f 100644 --- a/cucumber-core.api.md +++ b/cucumber-core.api.md @@ -30,6 +30,7 @@ export class AmbiguousError extends Error { export interface AssembledTestCase { id: string; name: string; + pickleId: string; sourceReference: SourceReference; testSteps: ReadonlyArray; toMessage(): TestCase; diff --git a/src/makeTestPlan.ts b/src/makeTestPlan.ts index 8846d29..5089405 100644 --- a/src/makeTestPlan.ts +++ b/src/makeTestPlan.ts @@ -52,6 +52,7 @@ export function makeTestPlan( const location = query.findLocationOf(pickle) as MessagesLocation return { id: newId(), + pickleId: pickle.id, name: strategy.reduce(lineage, pickle), sourceReference: { uri: pickle.uri, @@ -65,7 +66,7 @@ export function makeTestPlan( toMessage() { return { id: this.id, - pickleId: pickle.id, + pickleId: this.pickleId, testSteps: this.testSteps.map((step) => step.toMessage()), testRunStartedId, } diff --git a/src/types.ts b/src/types.ts index 52c4a81..1cd60b1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -471,6 +471,10 @@ export interface AssembledTestCase { * A unique identifier for this test case */ id: string + /** + * The id of the pickle from which this test case is derived + */ + pickleId: string /** * A non-unique name for this test case * @remarks