Skip to content

Commit 0a4c4c8

Browse files
committed
Merge branch 'main' into renovate/read-pkg-up-replacement
# Conflicts: # package-lock.json # src/configuration/from_file.ts
2 parents c8342ee + 8e574d3 commit 0a4c4c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1332
-735
lines changed

CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ 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))
15+
16+
## [11.1.1] - 2024-12-11
17+
### Fixed
18+
- Correctly report error in publish plugin ([#2454](https://github.com/cucumber/cucumber-js/pull/2454))
19+
- Reverse AfterAll execution order ([#2456](https://github.com/cucumber/cucumber-js/pull/2456))
1120

1221
## [11.1.0] - 2024-11-17
1322
### Added
@@ -1649,7 +1658,8 @@ this.Given(), this.When(), this.Then() and this.defineStep() ([#2](https://githu
16491658

16501659
## 0.0.1
16511660

1652-
[Unreleased]: https://github.com/cucumber/cucumber-js/compare/v11.1.0...HEAD
1661+
[Unreleased]: https://github.com/cucumber/cucumber-js/compare/v11.1.1...HEAD
1662+
[11.1.1]: https://github.com/cucumber/cucumber-js/compare/v11.1.0...v11.1.1
16531663
[11.1.0]: https://github.com/cucumber/cucumber-js/compare/v11.0.1...v11.1.0
16541664
[11.0.1]: https://github.com/cucumber/cucumber-js/compare/v11.0.0...v11.0.1
16551665
[11.0.0]: https://github.com/cucumber/cucumber-js/compare/v10.9.0...v11.0.0

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<h1 align="center">
2-
<img src="./docs/images/logo.svg" alt="">
2+
<img src="./docs/images/logo.svg" alt="" width="75">
33
<br>
44
Cucumber
55
</h1>
66
<p align="center">
77
<b>Automated tests in plain language, for Node.js</b>
88
</p>
99

10-
[![#StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://vshymanskyy.github.io/StandWithUkraine)
11-
[![npm](https://img.shields.io/npm/v/@cucumber/cucumber.svg)](https://www.npmjs.com/package/@cucumber/cucumber)
12-
[![build](https://github.com/cucumber/cucumber-js/actions/workflows/build.yaml/badge.svg)](https://github.com/cucumber/cucumber-js/actions)
13-
[![coverage](https://coveralls.io/repos/github/cucumber/cucumber-js/badge.svg?branch=main)](https://coveralls.io/github/cucumber/cucumber-js?branch=master)
14-
[![backers](https://opencollective.com/cucumber/backers/badge.svg)](https://opencollective.com/cucumber)
15-
[![sponsors](https://opencollective.com/cucumber/sponsors/badge.svg)](https://opencollective.com/cucumber)
10+
<p align="center">
11+
<a href="https://www.npmjs.com/package/@cucumber/cucumber" style="text-decoration: none"><img src="https://img.shields.io/npm/v/@cucumber/cucumber?style=flat&color=dark-green" alt="Latest version on npm"></a>
12+
<a href="https://github.com/cucumber/cucumber-js/actions" style="text-decoration: none"><img src="https://github.com/cucumber/cucumber-js/actions/workflows/build.yaml/badge.svg" alt="Build status"></a>
13+
<a href="https://coveralls.io/github/cucumber/cucumber-js?branch=master" style="text-decoration: none"><img src="https://coveralls.io/repos/github/cucumber/cucumber-js/badge.svg?branch=main" alt="Coverage"></a>
14+
<a href="https://opencollective.com/cucumber"><img src="https://opencollective.com/cucumber/backers/badge.svg" alt="Backers"></a>
15+
<a href="https://opencollective.com/cucumber"><img src="https://opencollective.com/cucumber/sponsors/badge.svg" alt="Sponsors"></a>
16+
<a href="https://vshymanskyy.github.io/StandWithUkraine"><img src="https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg" alt="Ukraine solidarity"></a>
17+
</p>
1618

1719
[Cucumber](https://github.com/cucumber) is a tool for running automated tests written in plain language. Because they're
1820
written in plain language, they can be read by anyone on your team. Because they can be

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+
})

docs/images/logo.svg

+7-13
Loading

exports/api/report.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export interface IRunConfiguration {
101101
export interface IRunEnvironment {
102102
cwd?: string;
103103
debug?: boolean;
104-
env?: NodeJS.ProcessEnv;
104+
env?: Record<string, string | undefined>;
105105
stderr?: Writable;
106106
stdout?: Writable;
107107
}

features/before_after_all_hooks.feature

+17-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Feature: Environment Hooks
1515
"""
1616

1717
Scenario: before all / after all hooks
18+
19+
BeforeAll hooks run once each before any scenarios, in declaration order
20+
AfterAll hooks run once each after all scenarios, in reverse declaration order
21+
1822
Given a file named "features/support/hooks.js" with:
1923
"""
2024
const {AfterAll, BeforeAll, Given} = require('@cucumber/cucumber')
@@ -27,20 +31,30 @@ Feature: Environment Hooks
2731
counter += counter
2832
})
2933
30-
Given('first step', function() {
34+
BeforeAll(function() {
3135
expect(counter).to.eql(2)
3236
counter += counter
3337
})
3438
35-
Given('second step', function() {
39+
Given('first step', function() {
3640
expect(counter).to.eql(4)
3741
counter += counter
3842
})
3943
40-
AfterAll(function() {
44+
Given('second step', function() {
4145
expect(counter).to.eql(8)
4246
counter += counter
4347
})
48+
49+
AfterAll(function() {
50+
expect(counter).to.eql(32)
51+
counter += counter
52+
})
53+
54+
AfterAll(function() {
55+
expect(counter).to.eql(16)
56+
counter += counter
57+
})
4458
"""
4559
When I run cucumber-js
4660
Then it passes

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)