Skip to content

Commit

Permalink
chore: update docs, changelog, attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss committed Apr 21, 2024
1 parent 66d0b1b commit b6f1ba5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 41 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber

## [Unreleased]
### Added
- Add error message for pending steps ([#2392](https://github.com/cucumber/cucumber-js/pull/2393))
- Updated profiles to allow defining a default function profile to be used as profile builder ([#2384](https://github.com/cucumber/cucumber-js/pull/2384))
- Allow supplying error details for pending steps ([#2393](https://github.com/cucumber/cucumber-js/pull/2393))
- Allow defining a default function profile to be used as profile builder ([#2384](https://github.com/cucumber/cucumber-js/pull/2384))

### Fixed
- 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))

## [10.4.0] - 2024-04-07
### Added
Expand Down
41 changes: 4 additions & 37 deletions docs/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ The short tag is `-p`
cucumber-js -p my_profile
```

## Default profiles
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.

## Examples

### Simple Example
## Simple Example

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:

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

### Example using a default function

```javascript
module.exports = {
default: function buildProfiles() {
const common = {
requireModule: ['ts-node/register'],
require: ['support/**/*.ts'],
worldParameters: {
appUrl: process.env.MY_APP_URL || 'http://localhost:3000/'
}
}

return {
default: {
...common,
format: ['progress-bar', 'html:cucumber-report.html'],
},
ci: {
...common,
format: ['html:cucumber-report.html'],
publish: true
}
}
}
}
```
## Defining profiles dynamically

or its `esm` version:
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:

```javascript
export default function buildProfiles() {
export default function() {
const common = {
requireModule: ['ts-node/register'],
require: ['support/**/*.ts'],
Expand All @@ -126,8 +95,6 @@ export default function buildProfiles() {
}
```

This way the `buildProfiles` function will be invoked to discover profiles.

## Using Profiles for Arguments

Cucumber doesn't allow custom command line arguments. For example:
Expand Down
4 changes: 2 additions & 2 deletions docs/support_files/step_definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ setDefinitionFunctionWrapper(function (fn) {

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

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

Each interface has its own way of marking a step as skipped
* synchronous - return `'skipped'`
* asynchronous callback - execute the callback with `null, 'skipped'`
* asynchronous callback - execute the callback with `error|null, 'skipped'`
* asynchronous promise - promise resolves to `'skipped'`
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"abelalmeida <abelalmeida@u.boisestate.edu>",
"Adam Ark <Adam-ARK@users.noreply.github.com>",
"Ádám Gólya <adam.golya@lab.coop>",
"Ahmed Ashour (https://github.com/asashour)",
"ahulab <alexbaluha@gmail.com>",
"Alon Diamant <diamant.alon@gmail.com>",
"Artem Bronitsky <quex@yandex.ru>",
Expand Down Expand Up @@ -114,6 +115,7 @@
"Marcel Hoyer <mhoyer@pixelplastic.de>",
"Marco Muller <marco@remotemetering.net>",
"Mark Amery <markamery@btinternet.com>",
"Mark Stein (https://github.com/markstein)",
"Martin Delille <martin@phonations.com>",
"Máté Karácsony <k_mate@inf.elte.hu>",
"Mateusz Derks <mateusz.derks@schibsted.pl>",
Expand All @@ -130,6 +132,7 @@
"Niklas Närhinen <niklas@narhinen.net>",
"Niyaz Akhmetov <axmet180@gmail.com>",
"Noah Davis <noahd1@yahoo.com>",
"notaphplover (https://github.com/notaphplover)",
"Oliver Odo (https://github.com/olivierodo)",
"Oliver Rogers <oli.rogers@gmail.com>",
"Olivier Melcher <olivier.melcher@gmail.com>",
Expand Down

0 comments on commit b6f1ba5

Please sign in to comment.