Skip to content

Commit b6f1ba5

Browse files
committed
chore: update docs, changelog, attribution
1 parent 66d0b1b commit b6f1ba5

File tree

4 files changed

+14
-41
lines changed

4 files changed

+14
-41
lines changed

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber
99

1010
## [Unreleased]
1111
### Added
12-
- Add error message for pending steps ([#2392](https://github.com/cucumber/cucumber-js/pull/2393))
13-
- Updated profiles to allow defining a default function profile to be used as profile builder ([#2384](https://github.com/cucumber/cucumber-js/pull/2384))
12+
- Allow supplying error details for pending steps ([#2393](https://github.com/cucumber/cucumber-js/pull/2393))
13+
- Allow defining a default function profile to be used as profile builder ([#2384](https://github.com/cucumber/cucumber-js/pull/2384))
14+
15+
### Fixed
16+
- Various typing improvements and other fixes ([#2390](https://github.com/cucumber/cucumber-js/pull/2390), [#2391](https://github.com/cucumber/cucumber-js/pull/2391), [#2394](https://github.com/cucumber/cucumber-js/pull/2394))
1417

1518
## [10.4.0] - 2024-04-07
1619
### Added

docs/profiles.md

+4-37
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ The short tag is `-p`
1414
cucumber-js -p my_profile
1515
```
1616

17-
## Default profiles
18-
If defined, a `default` profile is used in case no profiles are specified at runtime. A default profile is either a profile or a function that returns either a profiles object or a `Promise` of profiles object. If defined this way, no other profile shall be defined.
19-
20-
## Examples
21-
22-
### Simple Example
17+
## Simple Example
2318

2419
Let's take the common case of having some things a bit different locally than on a continuous integration server. Here's the configuration we've been running locally:
2520

@@ -72,38 +67,12 @@ Now, if we just run `cucumber-js` with no arguments, it will pick up our profile
7267
cucumber-js -p ci
7368
```
7469

75-
### Example using a default function
76-
77-
```javascript
78-
module.exports = {
79-
default: function buildProfiles() {
80-
const common = {
81-
requireModule: ['ts-node/register'],
82-
require: ['support/**/*.ts'],
83-
worldParameters: {
84-
appUrl: process.env.MY_APP_URL || 'http://localhost:3000/'
85-
}
86-
}
87-
88-
return {
89-
default: {
90-
...common,
91-
format: ['progress-bar', 'html:cucumber-report.html'],
92-
},
93-
ci: {
94-
...common,
95-
format: ['html:cucumber-report.html'],
96-
publish: true
97-
}
98-
}
99-
}
100-
}
101-
```
70+
## Defining profiles dynamically
10271

103-
or its `esm` version:
72+
If you need to define your profiles dynamically (including asynchronously), you can use the `default` profile key/export to provide an async function that resolves to your profiles. This can be particularly useful in an ESM context where the profiles are static exports. Here's an example:
10473

10574
```javascript
106-
export default function buildProfiles() {
75+
export default function() {
10776
const common = {
10877
requireModule: ['ts-node/register'],
10978
require: ['support/**/*.ts'],
@@ -126,8 +95,6 @@ export default function buildProfiles() {
12695
}
12796
```
12897

129-
This way the `buildProfiles` function will be invoked to discover profiles.
130-
13198
## Using Profiles for Arguments
13299

133100
Cucumber doesn't allow custom command line arguments. For example:

docs/support_files/step_definitions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ setDefinitionFunctionWrapper(function (fn) {
103103

104104
Each interface has its own way of marking a step as pending
105105
* synchronous - return `'pending'`
106-
* asynchronous callback - execute the callback with `null, 'pending'`
106+
* asynchronous callback - execute the callback with `error|null, 'pending'`
107107
* asynchronous promise - promise resolves to `'pending'`
108108

109109
## Skipped steps
@@ -114,5 +114,5 @@ This can be used to mark a scenario as skipped based on a runtime condition.
114114

115115
Each interface has its own way of marking a step as skipped
116116
* synchronous - return `'skipped'`
117-
* asynchronous callback - execute the callback with `null, 'skipped'`
117+
* asynchronous callback - execute the callback with `error|null, 'skipped'`
118118
* asynchronous promise - promise resolves to `'skipped'`

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"abelalmeida <[email protected]>",
1818
"Adam Ark <[email protected]>",
1919
"Ádám Gólya <[email protected]>",
20+
"Ahmed Ashour (https://github.com/asashour)",
2021
"ahulab <[email protected]>",
2122
"Alon Diamant <[email protected]>",
2223
"Artem Bronitsky <[email protected]>",
@@ -114,6 +115,7 @@
114115
"Marcel Hoyer <[email protected]>",
115116
"Marco Muller <[email protected]>",
116117
"Mark Amery <[email protected]>",
118+
"Mark Stein (https://github.com/markstein)",
117119
"Martin Delille <[email protected]>",
118120
"Máté Karácsony <[email protected]>",
119121
"Mateusz Derks <[email protected]>",
@@ -130,6 +132,7 @@
130132
"Niklas Närhinen <[email protected]>",
131133
"Niyaz Akhmetov <[email protected]>",
132134
"Noah Davis <[email protected]>",
135+
"notaphplover (https://github.com/notaphplover)",
133136
"Oliver Odo (https://github.com/olivierodo)",
134137
"Oliver Rogers <[email protected]>",
135138
"Olivier Melcher <[email protected]>",

0 commit comments

Comments
 (0)