Skip to content

Commit 8e574d3

Browse files
authored
Add hook types and test run ids (#2463)
1 parent 711d902 commit 8e574d3

File tree

13 files changed

+302
-273
lines changed

13 files changed

+302
-273
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber.
99

1010
## [Unreleased]
11+
### Added
12+
- `junit` formatter now includes `timestamp` attribute ([junit-xml-formatter#45](https://github.com/cucumber/junit-xml-formatter/pull/45))
13+
- `Hook` message now includes `type` ([#2463](https://github.com/cucumber/cucumber-js/pull/2463))
14+
- `TestRunStarted` message now includes `id`; `TestCase` and `TestRunFinished` messages reference it in `testRunStartedId` ([#2463](https://github.com/cucumber/cucumber-js/pull/2463))
1115

1216
## [11.1.1] - 2024-12-11
1317
### Fixed

compatibility/features/attachments/attachments.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3-
import { Before, When } from '../../../src'
4-
5-
Before(() => undefined)
3+
import { When } from '../../../src'
64

75
When(
86
'the string {string} is attached as {string}',
@@ -90,3 +88,7 @@ When('a PDF document is attached and renamed', async function () {
9088
}
9189
)
9290
})
91+
92+
When('a link to {string} is attached', async function (uri: string) {
93+
this.link(uri)
94+
})
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
import assert from 'node:assert'
22
import { Given, When, Then } from '../../../src'
33

4-
type World = {
5-
count: number
6-
}
4+
Given('there are {int} cucumbers', function (initialCount: number) {
5+
this.count = initialCount
6+
})
77

8-
Given(
9-
'there are {int} cucumbers',
10-
function (this: World, initialCount: number) {
11-
this.count = initialCount
12-
}
13-
)
8+
Given('there are {int} friends', function (initialFriends: number) {
9+
this.friends = initialFriends
10+
})
1411

15-
When('I eat {int} cucumbers', function (this: World, eatCount: number) {
12+
When('I eat {int} cucumbers', function (eatCount: number) {
1613
this.count -= eatCount
1714
})
1815

19-
Then(
20-
'I should have {int} cucumbers',
21-
function (this: World, expectedCount: number) {
22-
assert.strictEqual(this.count, expectedCount)
23-
}
24-
)
16+
Then('I should have {int} cucumbers', function (expectedCount: number) {
17+
assert.strictEqual(this.count, expectedCount)
18+
})
19+
20+
Then('each person can eat {int} cucumbers', function (expectedShare) {
21+
const share = Math.floor(this.count / (1 + this.friends))
22+
assert.strictEqual(share, expectedShare)
23+
})

features/support/formatter_output_helpers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export const ignorableKeys = [
110110
'pickleId',
111111
'pickleStepId',
112112
'stepDefinitionIds',
113+
'testRunStartedId',
113114
'testCaseId',
114115
'testCaseStartedId',
115116
'testStepId',

0 commit comments

Comments
 (0)