Skip to content

Commit ab78592

Browse files
authored
Upgrade gherkin, html-formatter, CCK (#2564)
1 parent d8bd294 commit ab78592

File tree

8 files changed

+138
-60
lines changed

8 files changed

+138
-60
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ 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+
- Allow comments inside descriptions ([cucumber/gherkin#334](https://github.com/cucumber/gherkin/pull/334))
13+
14+
### Changed
15+
- Redesigned HTML formatter header ([cucumber/react-components#381](https://github.com/cucumber/react-components/pull/381))
1116

1217
## [11.3.0] - 2025-05-14
1318
### Changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
import { When } from '../../../src'
4+
5+
When('a JPEG image is attached', async function () {
6+
await this.attach(
7+
fs.createReadStream(
8+
path.join(
9+
process.cwd(),
10+
'node_modules',
11+
'@cucumber',
12+
'compatibility-kit',
13+
'features',
14+
'attachments',
15+
'cucumber.jpeg'
16+
)
17+
),
18+
'image/jpeg'
19+
)
20+
})
21+
22+
When('a PNG image is attached', async function () {
23+
await this.attach(
24+
fs.createReadStream(
25+
path.join(
26+
process.cwd(),
27+
'node_modules',
28+
'@cucumber',
29+
'compatibility-kit',
30+
'features',
31+
'attachments',
32+
'cucumber.png'
33+
)
34+
),
35+
'image/png'
36+
)
37+
})
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
import { Before, When, After } from '../../../src'
4+
5+
Before(async function () {
6+
await this.attach(
7+
fs.createReadStream(
8+
path.join(
9+
process.cwd(),
10+
'node_modules',
11+
'@cucumber',
12+
'compatibility-kit',
13+
'features',
14+
'hooks-attachment',
15+
'cucumber.svg'
16+
)
17+
),
18+
'image/svg+xml'
19+
)
20+
})
21+
22+
When('a step passes', function () {
23+
// no-op
24+
})
25+
26+
After(async function () {
27+
await this.attach(
28+
fs.createReadStream(
29+
path.join(
30+
process.cwd(),
31+
'node_modules',
32+
'@cucumber',
33+
'compatibility-kit',
34+
'features',
35+
'hooks-attachment',
36+
'cucumber.svg'
37+
)
38+
),
39+
'image/svg+xml'
40+
)
41+
})
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Before, When, After } from '../../../src'
2+
3+
Before('@passing-hook', async function () {
4+
// no-op
5+
})
6+
7+
Before('@fail-before', function () {
8+
throw new Error('Exception in conditional hook')
9+
})
10+
11+
When('a step passes', function () {
12+
// no-op
13+
})
14+
15+
After('@fail-after', function () {
16+
throw new Error('Exception in conditional hook')
17+
})
18+
19+
After('@passing-hook', async function () {
20+
// no-op
21+
})
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Before, When, After } from '../../../src'
2+
3+
Before({ name: 'A named before hook' }, function () {
4+
// no-op
5+
})
6+
7+
When('a step passes', function () {
8+
// no-op
9+
})
10+
11+
After({ name: 'A named after hook' }, function () {
12+
// no-op
13+
})

compatibility/features/hooks/hooks.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
import fs from 'node:fs'
2-
import path from 'node:path'
31
import { When, Before, After } from '../../../src'
42

53
Before(function () {
64
// no-op
75
})
86

9-
Before({ name: 'A named hook' }, function () {
10-
// no-op
11-
})
12-
137
When('a step passes', function () {
148
// no-op
159
})
@@ -21,24 +15,3 @@ When('a step fails', function () {
2115
After(function () {
2216
// no-op
2317
})
24-
25-
After('@some-tag or @some-other-tag', function () {
26-
throw new Error('Exception in conditional hook')
27-
})
28-
29-
After('@with-attachment', async function () {
30-
await this.attach(
31-
fs.createReadStream(
32-
path.join(
33-
process.cwd(),
34-
'node_modules',
35-
'@cucumber',
36-
'compatibility-kit',
37-
'features',
38-
'hooks',
39-
'cucumber.svg'
40-
)
41-
),
42-
'image/svg+xml'
43-
)
44-
})

package-lock.json

Lines changed: 17 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@
218218
"dependencies": {
219219
"@cucumber/ci-environment": "10.0.1",
220220
"@cucumber/cucumber-expressions": "18.0.1",
221-
"@cucumber/gherkin": "30.0.4",
221+
"@cucumber/gherkin": "32.1.2",
222222
"@cucumber/gherkin-streams": "5.0.1",
223223
"@cucumber/gherkin-utils": "9.2.0",
224-
"@cucumber/html-formatter": "21.10.1",
224+
"@cucumber/html-formatter": "21.11.0",
225225
"@cucumber/junit-xml-formatter": "0.7.1",
226226
"@cucumber/message-streams": "4.0.1",
227227
"@cucumber/messages": "27.2.0",
228-
"@cucumber/tag-expressions": "6.1.2",
228+
"@cucumber/tag-expressions": "6.2.0",
229229
"assertion-error-formatter": "^3.0.0",
230230
"capital-case": "^1.0.4",
231231
"chalk": "^4.1.2",
@@ -257,7 +257,7 @@
257257
"yup": "1.6.1"
258258
},
259259
"devDependencies": {
260-
"@cucumber/compatibility-kit": "17.0.1",
260+
"@cucumber/compatibility-kit": "18.0.3",
261261
"@cucumber/query": "13.2.0",
262262
"@microsoft/api-extractor": "7.52.7",
263263
"@sinonjs/fake-timers": "14.0.0",

0 commit comments

Comments
 (0)