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]
### Added
- BREAKING CHANGE: Add `testRunStartedId` to `TestPlanIngredients` ([#3](https://github.com/cucumber/javascript-core/pull/3))

## [0.1.0] - 2025-07-24
### Added
Expand Down
1 change: 1 addition & 0 deletions cucumber-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export interface TestPlanIngredients {
gherkinDocument: GherkinDocument;
pickles: ReadonlyArray<Pickle>;
supportCodeLibrary: SupportCodeLibrary;
testRunStartedId: string;
}

// @public
Expand Down
89 changes: 18 additions & 71 deletions src/makeTestPlan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function parseGherkin(

describe('makeTestPlan', () => {
class FakeWorld {}

const testRunStartedId = 'run-id'
let newId: () => string

beforeEach(() => {
Expand All @@ -51,6 +51,7 @@ describe('makeTestPlan', () => {

const result = makeTestPlan(
{
testRunStartedId,
gherkinDocument,
pickles,
supportCodeLibrary,
Expand All @@ -69,6 +70,7 @@ describe('makeTestPlan', () => {

const result = makeTestPlan(
{
testRunStartedId,
gherkinDocument,
pickles,
supportCodeLibrary,
Expand All @@ -86,11 +88,7 @@ describe('makeTestPlan', () => {
const supportCodeLibrary = buildSupportCode({ newId }).build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand All @@ -111,11 +109,7 @@ describe('makeTestPlan', () => {
const supportCodeLibrary = buildSupportCode({ newId }).build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
strategy: {
Expand Down Expand Up @@ -154,11 +148,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand All @@ -172,11 +162,7 @@ describe('makeTestPlan', () => {
const supportCodeLibrary = buildSupportCode({ newId }).build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand All @@ -201,11 +187,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -235,11 +217,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -269,11 +247,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -308,11 +282,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -359,11 +329,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -414,11 +380,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -484,11 +446,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -528,11 +486,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -566,11 +520,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -605,11 +555,7 @@ describe('makeTestPlan', () => {
.build()

const result = makeTestPlan(
{
gherkinDocument,
pickles,
supportCodeLibrary,
},
{ testRunStartedId, gherkinDocument, pickles, supportCodeLibrary },
{
newId,
}
Expand Down Expand Up @@ -657,6 +603,7 @@ describe('makeTestPlan', () => {
id: '10',
},
],
testRunStartedId,
},
},
])
Expand Down
3 changes: 2 additions & 1 deletion src/makeTestPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function makeTestPlan(
ingredients: TestPlanIngredients,
options: TestPlanOptions = {}
): AssembledTestPlan {
const { gherkinDocument, pickles, supportCodeLibrary } = ingredients
const { testRunStartedId, gherkinDocument, pickles, supportCodeLibrary } = ingredients
const {
newId = IdGenerator.uuid(),
strategy = namingStrategy(
Expand All @@ -61,6 +61,7 @@ export function makeTestPlan(
id: this.id,
pickleId: pickle.id,
testSteps: this.steps.map((step) => step.toMessage()),
testRunStartedId,
}
},
}
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ export type MatchedStep = {
* @public
*/
export interface TestPlanIngredients {
/**
* Identifier for the test run within which this plan will be executed
*/
testRunStartedId: string
/**
* The Gherkin document that has been processed
*/
Expand Down
Loading