diff --git a/.github/workflows/site.yaml b/.github/workflows/site.yaml
new file mode 100644
index 000000000..df958110c
--- /dev/null
+++ b/.github/workflows/site.yaml
@@ -0,0 +1,35 @@
+name: Site
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ upload-artifact:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 20.x
+ - run: npm install
+ - run: npm run exports-generate-docs
+ - run: |
+ chmod -c -R +rX "_site/" | while read line; do
+ echo "::warning title=Invalid file permissions automatically fixed::$line"
+ done
+ - uses: actions/upload-pages-artifact@v3
+
+ deploy:
+ needs: upload-artifact
+ permissions:
+ pages: write
+ id-token: write
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ steps:
+ - id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/.gitignore b/.gitignore
index f132de3eb..49f8cdeb3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
.nyc_output_feature/
.nyc_output_unit/
.nyc_output/
+_site/
@rerun.txt
coverage/
lib/
diff --git a/.prettierignore b/.prettierignore
index 6de2746ed..2153db630 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,5 +1,6 @@
bin
docs
+exports
lib
node_modules
reports
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3a67424df..661b45e18 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber.
## [Unreleased]
+### Changed
+- Improve API documentation and TypeScript types ([#2367](https://github.com/cucumber/cucumber-js/pull/2367))
## [10.1.0] - 2023-12-21
### Added
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 65a2e5687..56250c43e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -41,9 +41,9 @@ Type `npm run` or see the `package.json` scripts section for how to run each cat
* feature tests - `npm run feature-test`
* cucumber-js tests itself
-## API Documentation
+## Exports
-The functionality exposed under the `@cucumber/cucumber/api` entry point is analysed and has documentation generated by [API Extractor](https://api-extractor.com/). If you make a change that affects the public API surface, you'll need to run `npm run docs:local` to run the analysis and regenerate the docs, and commit the changes. If you forget to do this locally, the CI build will fail and remind you.
+The functionality exposed under both the `@cucumber/cucumber` and `@cucumber/cucumber/api` entry points is analysed and has a report generated by [API Extractor](https://api-extractor.com/). If you make a change that affects the exported API surface, you'll need to run `npm run exports-update` to run the analysis and regenerate the file, and commit the changes. If you forget to do this locally, the CI build will fail and remind you.
## Internals
diff --git a/dependency-lint.yml b/dependency-lint.yml
index 3b728e1ce..9b924949a 100644
--- a/dependency-lint.yml
+++ b/dependency-lint.yml
@@ -5,8 +5,9 @@ executedModules:
npmScripts:
dev:
- build
- - docs:ci
- - docs:local
+ - exports-generate-docs
+ - exports-test
+ - exports-update
- lint
- publish
- test
@@ -37,6 +38,7 @@ ignoreErrors:
- prettier # peer dependency of eslint-plugin-prettier
- ts-node # .mocharc.yml / cucumber.js
- type-fest # utility types
+ - typedoc-plugin-extras
requiredModules:
files:
diff --git a/docs/api/cucumber.iloadconfigurationoptions.file.md b/docs/api/cucumber.iloadconfigurationoptions.file.md
deleted file mode 100644
index 47961cee0..000000000
--- a/docs/api/cucumber.iloadconfigurationoptions.file.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) > [file](./cucumber.iloadconfigurationoptions.file.md)
-
-## ILoadConfigurationOptions.file property
-
-Path to load configuration file from (defaults to `cucumber.(js|cjs|mjs|json)` if omitted).
-
-Signature:
-
-```typescript
-file?: string;
-```
diff --git a/docs/api/cucumber.iloadconfigurationoptions.md b/docs/api/cucumber.iloadconfigurationoptions.md
deleted file mode 100644
index 14ee2e557..000000000
--- a/docs/api/cucumber.iloadconfigurationoptions.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md)
-
-## ILoadConfigurationOptions interface
-
-
-Signature:
-
-```typescript
-export interface ILoadConfigurationOptions
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [file?](./cucumber.iloadconfigurationoptions.file.md) | string | (Optional) Path to load configuration file from (defaults to cucumber.(js|cjs|mjs|json)
if omitted). |
-| [profiles?](./cucumber.iloadconfigurationoptions.profiles.md) | string\[\] | (Optional) Zero or more profile names from which to source configuration (if omitted or empty, the default
profile will be used). |
-| [provided?](./cucumber.iloadconfigurationoptions.provided.md) | Partial<IConfiguration> | (Optional) Ad-hoc configuration options to be applied over the top of whatever is loaded from the configuration file/profiles. |
-
diff --git a/docs/api/cucumber.iloadconfigurationoptions.profiles.md b/docs/api/cucumber.iloadconfigurationoptions.profiles.md
deleted file mode 100644
index 35c129e88..000000000
--- a/docs/api/cucumber.iloadconfigurationoptions.profiles.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) > [profiles](./cucumber.iloadconfigurationoptions.profiles.md)
-
-## ILoadConfigurationOptions.profiles property
-
-Zero or more profile names from which to source configuration (if omitted or empty, the `default` profile will be used).
-
-Signature:
-
-```typescript
-profiles?: string[];
-```
diff --git a/docs/api/cucumber.iloadconfigurationoptions.provided.md b/docs/api/cucumber.iloadconfigurationoptions.provided.md
deleted file mode 100644
index 7078e6962..000000000
--- a/docs/api/cucumber.iloadconfigurationoptions.provided.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) > [provided](./cucumber.iloadconfigurationoptions.provided.md)
-
-## ILoadConfigurationOptions.provided property
-
-Ad-hoc configuration options to be applied over the top of whatever is loaded from the configuration file/profiles.
-
-Signature:
-
-```typescript
-provided?: Partial;
-```
diff --git a/docs/api/cucumber.iloadsourcesresult.errors.md b/docs/api/cucumber.iloadsourcesresult.errors.md
deleted file mode 100644
index 9f98a5f87..000000000
--- a/docs/api/cucumber.iloadsourcesresult.errors.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadSourcesResult](./cucumber.iloadsourcesresult.md) > [errors](./cucumber.iloadsourcesresult.errors.md)
-
-## ILoadSourcesResult.errors property
-
-Signature:
-
-```typescript
-errors: ISourcesError[];
-```
diff --git a/docs/api/cucumber.iloadsourcesresult.md b/docs/api/cucumber.iloadsourcesresult.md
deleted file mode 100644
index 730105f5f..000000000
--- a/docs/api/cucumber.iloadsourcesresult.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadSourcesResult](./cucumber.iloadsourcesresult.md)
-
-## ILoadSourcesResult interface
-
-
-Signature:
-
-```typescript
-export interface ILoadSourcesResult
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [errors](./cucumber.iloadsourcesresult.errors.md) | [ISourcesError](./cucumber.isourceserror.md)\[\] | |
-| [plan](./cucumber.iloadsourcesresult.plan.md) | [IPlannedPickle](./cucumber.iplannedpickle.md)\[\] | |
-
diff --git a/docs/api/cucumber.iloadsourcesresult.plan.md b/docs/api/cucumber.iloadsourcesresult.plan.md
deleted file mode 100644
index 8847c0ed6..000000000
--- a/docs/api/cucumber.iloadsourcesresult.plan.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadSourcesResult](./cucumber.iloadsourcesresult.md) > [plan](./cucumber.iloadsourcesresult.plan.md)
-
-## ILoadSourcesResult.plan property
-
-Signature:
-
-```typescript
-plan: IPlannedPickle[];
-```
diff --git a/docs/api/cucumber.iloadsupportoptions.md b/docs/api/cucumber.iloadsupportoptions.md
deleted file mode 100644
index 1722a0953..000000000
--- a/docs/api/cucumber.iloadsupportoptions.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadSupportOptions](./cucumber.iloadsupportoptions.md)
-
-## ILoadSupportOptions interface
-
-
-Signature:
-
-```typescript
-export interface ILoadSupportOptions
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [sources](./cucumber.iloadsupportoptions.sources.md) | [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | |
-| [support](./cucumber.iloadsupportoptions.support.md) | [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) | |
-
diff --git a/docs/api/cucumber.iloadsupportoptions.sources.md b/docs/api/cucumber.iloadsupportoptions.sources.md
deleted file mode 100644
index 7d9ad0b5a..000000000
--- a/docs/api/cucumber.iloadsupportoptions.sources.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadSupportOptions](./cucumber.iloadsupportoptions.md) > [sources](./cucumber.iloadsupportoptions.sources.md)
-
-## ILoadSupportOptions.sources property
-
-Signature:
-
-```typescript
-sources: ISourcesCoordinates;
-```
diff --git a/docs/api/cucumber.iloadsupportoptions.support.md b/docs/api/cucumber.iloadsupportoptions.support.md
deleted file mode 100644
index 222dd6c9a..000000000
--- a/docs/api/cucumber.iloadsupportoptions.support.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ILoadSupportOptions](./cucumber.iloadsupportoptions.md) > [support](./cucumber.iloadsupportoptions.support.md)
-
-## ILoadSupportOptions.support property
-
-Signature:
-
-```typescript
-support: ISupportCodeCoordinates;
-```
diff --git a/docs/api/cucumber.iplannedpickle.location.md b/docs/api/cucumber.iplannedpickle.location.md
deleted file mode 100644
index 4aee3845b..000000000
--- a/docs/api/cucumber.iplannedpickle.location.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IPlannedPickle](./cucumber.iplannedpickle.md) > [location](./cucumber.iplannedpickle.location.md)
-
-## IPlannedPickle.location property
-
-Signature:
-
-```typescript
-location: {
- line: number;
- column?: number;
- };
-```
diff --git a/docs/api/cucumber.iplannedpickle.md b/docs/api/cucumber.iplannedpickle.md
deleted file mode 100644
index 4c6144682..000000000
--- a/docs/api/cucumber.iplannedpickle.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IPlannedPickle](./cucumber.iplannedpickle.md)
-
-## IPlannedPickle interface
-
-
-Signature:
-
-```typescript
-export interface IPlannedPickle
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [location](./cucumber.iplannedpickle.location.md) | { line: number; column?: number; } | |
-| [name](./cucumber.iplannedpickle.name.md) | string | |
-| [uri](./cucumber.iplannedpickle.uri.md) | string | |
-
diff --git a/docs/api/cucumber.iplannedpickle.name.md b/docs/api/cucumber.iplannedpickle.name.md
deleted file mode 100644
index b09ab16b9..000000000
--- a/docs/api/cucumber.iplannedpickle.name.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IPlannedPickle](./cucumber.iplannedpickle.md) > [name](./cucumber.iplannedpickle.name.md)
-
-## IPlannedPickle.name property
-
-Signature:
-
-```typescript
-name: string;
-```
diff --git a/docs/api/cucumber.iplannedpickle.uri.md b/docs/api/cucumber.iplannedpickle.uri.md
deleted file mode 100644
index 905aefb67..000000000
--- a/docs/api/cucumber.iplannedpickle.uri.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IPlannedPickle](./cucumber.iplannedpickle.md) > [uri](./cucumber.iplannedpickle.uri.md)
-
-## IPlannedPickle.uri property
-
-Signature:
-
-```typescript
-uri: string;
-```
diff --git a/docs/api/cucumber.iresolvedconfiguration.md b/docs/api/cucumber.iresolvedconfiguration.md
deleted file mode 100644
index d99bb7c30..000000000
--- a/docs/api/cucumber.iresolvedconfiguration.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md)
-
-## IResolvedConfiguration interface
-
-
-Signature:
-
-```typescript
-export interface IResolvedConfiguration
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [runConfiguration](./cucumber.iresolvedconfiguration.runconfiguration.md) | [IRunConfiguration](./cucumber.irunconfiguration.md) | The format that can be passed into runCucumber
. |
-| [useConfiguration](./cucumber.iresolvedconfiguration.useconfiguration.md) | IConfiguration | The final flat configuration object resolved from the configuration file/profiles plus any extra provided. |
-
diff --git a/docs/api/cucumber.iresolvedconfiguration.runconfiguration.md b/docs/api/cucumber.iresolvedconfiguration.runconfiguration.md
deleted file mode 100644
index 2e9264b0f..000000000
--- a/docs/api/cucumber.iresolvedconfiguration.runconfiguration.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md) > [runConfiguration](./cucumber.iresolvedconfiguration.runconfiguration.md)
-
-## IResolvedConfiguration.runConfiguration property
-
-The format that can be passed into `runCucumber`.
-
-Signature:
-
-```typescript
-runConfiguration: IRunConfiguration;
-```
diff --git a/docs/api/cucumber.iresolvedconfiguration.useconfiguration.md b/docs/api/cucumber.iresolvedconfiguration.useconfiguration.md
deleted file mode 100644
index ae5aef140..000000000
--- a/docs/api/cucumber.iresolvedconfiguration.useconfiguration.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md) > [useConfiguration](./cucumber.iresolvedconfiguration.useconfiguration.md)
-
-## IResolvedConfiguration.useConfiguration property
-
-The final flat configuration object resolved from the configuration file/profiles plus any extra provided.
-
-Signature:
-
-```typescript
-useConfiguration: IConfiguration;
-```
diff --git a/docs/api/cucumber.irunconfiguration.formats.md b/docs/api/cucumber.irunconfiguration.formats.md
deleted file mode 100644
index 6a4578565..000000000
--- a/docs/api/cucumber.irunconfiguration.formats.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunConfiguration](./cucumber.irunconfiguration.md) > [formats](./cucumber.irunconfiguration.formats.md)
-
-## IRunConfiguration.formats property
-
-Signature:
-
-```typescript
-formats: IRunOptionsFormats;
-```
diff --git a/docs/api/cucumber.irunconfiguration.md b/docs/api/cucumber.irunconfiguration.md
deleted file mode 100644
index 2e42f2ec6..000000000
--- a/docs/api/cucumber.irunconfiguration.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunConfiguration](./cucumber.irunconfiguration.md)
-
-## IRunConfiguration interface
-
-
-Signature:
-
-```typescript
-export interface IRunConfiguration
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [formats](./cucumber.irunconfiguration.formats.md) | [IRunOptionsFormats](./cucumber.irunoptionsformats.md) | |
-| [runtime](./cucumber.irunconfiguration.runtime.md) | [IRunOptionsRuntime](./cucumber.irunoptionsruntime.md) | |
-| [sources](./cucumber.irunconfiguration.sources.md) | [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | |
-| [support](./cucumber.irunconfiguration.support.md) | [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) | |
-
diff --git a/docs/api/cucumber.irunconfiguration.runtime.md b/docs/api/cucumber.irunconfiguration.runtime.md
deleted file mode 100644
index 7c651576d..000000000
--- a/docs/api/cucumber.irunconfiguration.runtime.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunConfiguration](./cucumber.irunconfiguration.md) > [runtime](./cucumber.irunconfiguration.runtime.md)
-
-## IRunConfiguration.runtime property
-
-Signature:
-
-```typescript
-runtime: IRunOptionsRuntime;
-```
diff --git a/docs/api/cucumber.irunconfiguration.sources.md b/docs/api/cucumber.irunconfiguration.sources.md
deleted file mode 100644
index e0a68beda..000000000
--- a/docs/api/cucumber.irunconfiguration.sources.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunConfiguration](./cucumber.irunconfiguration.md) > [sources](./cucumber.irunconfiguration.sources.md)
-
-## IRunConfiguration.sources property
-
-Signature:
-
-```typescript
-sources: ISourcesCoordinates;
-```
diff --git a/docs/api/cucumber.irunconfiguration.support.md b/docs/api/cucumber.irunconfiguration.support.md
deleted file mode 100644
index 07036bc2c..000000000
--- a/docs/api/cucumber.irunconfiguration.support.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunConfiguration](./cucumber.irunconfiguration.md) > [support](./cucumber.irunconfiguration.support.md)
-
-## IRunConfiguration.support property
-
-Signature:
-
-```typescript
-support: ISupportCodeCoordinates;
-```
diff --git a/docs/api/cucumber.irunenvironment.cwd.md b/docs/api/cucumber.irunenvironment.cwd.md
deleted file mode 100644
index efe7d2aa3..000000000
--- a/docs/api/cucumber.irunenvironment.cwd.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunEnvironment](./cucumber.irunenvironment.md) > [cwd](./cucumber.irunenvironment.cwd.md)
-
-## IRunEnvironment.cwd property
-
-Working directory for the project (defaults to `process.cwd()` if omitted).
-
-Signature:
-
-```typescript
-cwd?: string;
-```
diff --git a/docs/api/cucumber.irunenvironment.env.md b/docs/api/cucumber.irunenvironment.env.md
deleted file mode 100644
index cac334c97..000000000
--- a/docs/api/cucumber.irunenvironment.env.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunEnvironment](./cucumber.irunenvironment.md) > [env](./cucumber.irunenvironment.env.md)
-
-## IRunEnvironment.env property
-
-Environment variables (defaults to `process.env` if omitted).
-
-Signature:
-
-```typescript
-env?: NodeJS.ProcessEnv;
-```
diff --git a/docs/api/cucumber.irunenvironment.md b/docs/api/cucumber.irunenvironment.md
deleted file mode 100644
index a563ff692..000000000
--- a/docs/api/cucumber.irunenvironment.md
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunEnvironment](./cucumber.irunenvironment.md)
-
-## IRunEnvironment interface
-
-Contextual data about the project environment.
-
-Signature:
-
-```typescript
-export interface IRunEnvironment
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [cwd?](./cucumber.irunenvironment.cwd.md) | string | (Optional) Working directory for the project (defaults to process.cwd()
if omitted). |
-| [env?](./cucumber.irunenvironment.env.md) | NodeJS.ProcessEnv | (Optional) Environment variables (defaults to process.env
if omitted). |
-| [stderr?](./cucumber.irunenvironment.stderr.md) | IFormatterStream | (Optional) Writable stream where the test run's warning/error output is written (defaults to process.stderr
if omitted). |
-| [stdout?](./cucumber.irunenvironment.stdout.md) | IFormatterStream | (Optional) Writable stream where the test run's main output is written (defaults to process.stdout
if omitted). |
-
diff --git a/docs/api/cucumber.irunenvironment.stderr.md b/docs/api/cucumber.irunenvironment.stderr.md
deleted file mode 100644
index 4a0162c95..000000000
--- a/docs/api/cucumber.irunenvironment.stderr.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunEnvironment](./cucumber.irunenvironment.md) > [stderr](./cucumber.irunenvironment.stderr.md)
-
-## IRunEnvironment.stderr property
-
-Writable stream where the test run's warning/error output is written (defaults to `process.stderr` if omitted).
-
-Signature:
-
-```typescript
-stderr?: IFormatterStream;
-```
diff --git a/docs/api/cucumber.irunenvironment.stdout.md b/docs/api/cucumber.irunenvironment.stdout.md
deleted file mode 100644
index f72e61807..000000000
--- a/docs/api/cucumber.irunenvironment.stdout.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunEnvironment](./cucumber.irunenvironment.md) > [stdout](./cucumber.irunenvironment.stdout.md)
-
-## IRunEnvironment.stdout property
-
-Writable stream where the test run's main output is written (defaults to `process.stdout` if omitted).
-
-Signature:
-
-```typescript
-stdout?: IFormatterStream;
-```
diff --git a/docs/api/cucumber.irunoptions.formats.md b/docs/api/cucumber.irunoptions.formats.md
deleted file mode 100644
index c31e76fb5..000000000
--- a/docs/api/cucumber.irunoptions.formats.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptions](./cucumber.irunoptions.md) > [formats](./cucumber.irunoptions.formats.md)
-
-## IRunOptions.formats property
-
-Signature:
-
-```typescript
-formats: IRunOptionsFormats;
-```
diff --git a/docs/api/cucumber.irunoptions.md b/docs/api/cucumber.irunoptions.md
deleted file mode 100644
index 836b6d3e2..000000000
--- a/docs/api/cucumber.irunoptions.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptions](./cucumber.irunoptions.md)
-
-## IRunOptions interface
-
-
-Signature:
-
-```typescript
-export interface IRunOptions
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [formats](./cucumber.irunoptions.formats.md) | [IRunOptionsFormats](./cucumber.irunoptionsformats.md) | |
-| [runtime](./cucumber.irunoptions.runtime.md) | [IRunOptionsRuntime](./cucumber.irunoptionsruntime.md) | |
-| [sources](./cucumber.irunoptions.sources.md) | [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | |
-| [support](./cucumber.irunoptions.support.md) | [ISupportCodeCoordinatesOrLibrary](./cucumber.isupportcodecoordinatesorlibrary.md) | |
-
diff --git a/docs/api/cucumber.irunoptions.runtime.md b/docs/api/cucumber.irunoptions.runtime.md
deleted file mode 100644
index ec46ae891..000000000
--- a/docs/api/cucumber.irunoptions.runtime.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptions](./cucumber.irunoptions.md) > [runtime](./cucumber.irunoptions.runtime.md)
-
-## IRunOptions.runtime property
-
-Signature:
-
-```typescript
-runtime: IRunOptionsRuntime;
-```
diff --git a/docs/api/cucumber.irunoptions.sources.md b/docs/api/cucumber.irunoptions.sources.md
deleted file mode 100644
index 2b5fba724..000000000
--- a/docs/api/cucumber.irunoptions.sources.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptions](./cucumber.irunoptions.md) > [sources](./cucumber.irunoptions.sources.md)
-
-## IRunOptions.sources property
-
-Signature:
-
-```typescript
-sources: ISourcesCoordinates;
-```
diff --git a/docs/api/cucumber.irunoptions.support.md b/docs/api/cucumber.irunoptions.support.md
deleted file mode 100644
index d89dc3652..000000000
--- a/docs/api/cucumber.irunoptions.support.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptions](./cucumber.irunoptions.md) > [support](./cucumber.irunoptions.support.md)
-
-## IRunOptions.support property
-
-Signature:
-
-```typescript
-support: ISupportCodeCoordinatesOrLibrary;
-```
diff --git a/docs/api/cucumber.irunoptionsformats.files.md b/docs/api/cucumber.irunoptionsformats.files.md
deleted file mode 100644
index c9b701526..000000000
--- a/docs/api/cucumber.irunoptionsformats.files.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsFormats](./cucumber.irunoptionsformats.md) > [files](./cucumber.irunoptionsformats.files.md)
-
-## IRunOptionsFormats.files property
-
-Signature:
-
-```typescript
-files: Record;
-```
diff --git a/docs/api/cucumber.irunoptionsformats.md b/docs/api/cucumber.irunoptionsformats.md
deleted file mode 100644
index f2a9c337b..000000000
--- a/docs/api/cucumber.irunoptionsformats.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsFormats](./cucumber.irunoptionsformats.md)
-
-## IRunOptionsFormats interface
-
-
-Signature:
-
-```typescript
-export interface IRunOptionsFormats
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [files](./cucumber.irunoptionsformats.files.md) | Record<string, string> | |
-| [options](./cucumber.irunoptionsformats.options.md) | FormatOptions | |
-| [publish](./cucumber.irunoptionsformats.publish.md) | { url?: string; token?: string; } \| false | |
-| [stdout](./cucumber.irunoptionsformats.stdout.md) | string | |
-
diff --git a/docs/api/cucumber.irunoptionsformats.options.md b/docs/api/cucumber.irunoptionsformats.options.md
deleted file mode 100644
index 696353b4d..000000000
--- a/docs/api/cucumber.irunoptionsformats.options.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsFormats](./cucumber.irunoptionsformats.md) > [options](./cucumber.irunoptionsformats.options.md)
-
-## IRunOptionsFormats.options property
-
-Signature:
-
-```typescript
-options: FormatOptions;
-```
diff --git a/docs/api/cucumber.irunoptionsformats.publish.md b/docs/api/cucumber.irunoptionsformats.publish.md
deleted file mode 100644
index d416ed77d..000000000
--- a/docs/api/cucumber.irunoptionsformats.publish.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsFormats](./cucumber.irunoptionsformats.md) > [publish](./cucumber.irunoptionsformats.publish.md)
-
-## IRunOptionsFormats.publish property
-
-Signature:
-
-```typescript
-publish: {
- url?: string;
- token?: string;
- } | false;
-```
diff --git a/docs/api/cucumber.irunoptionsformats.stdout.md b/docs/api/cucumber.irunoptionsformats.stdout.md
deleted file mode 100644
index 175c5708e..000000000
--- a/docs/api/cucumber.irunoptionsformats.stdout.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsFormats](./cucumber.irunoptionsformats.md) > [stdout](./cucumber.irunoptionsformats.stdout.md)
-
-## IRunOptionsFormats.stdout property
-
-Signature:
-
-```typescript
-stdout: string;
-```
diff --git a/docs/api/cucumber.irunoptionsruntime.md b/docs/api/cucumber.irunoptionsruntime.md
deleted file mode 100644
index 7c87ea4df..000000000
--- a/docs/api/cucumber.irunoptionsruntime.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsRuntime](./cucumber.irunoptionsruntime.md)
-
-## IRunOptionsRuntime interface
-
-
-Signature:
-
-```typescript
-export interface IRunOptionsRuntime extends IRuntimeOptions
-```
-Extends: IRuntimeOptions
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [parallel](./cucumber.irunoptionsruntime.parallel.md) | number | |
-
diff --git a/docs/api/cucumber.irunoptionsruntime.parallel.md b/docs/api/cucumber.irunoptionsruntime.parallel.md
deleted file mode 100644
index 6deaa4ab7..000000000
--- a/docs/api/cucumber.irunoptionsruntime.parallel.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunOptionsRuntime](./cucumber.irunoptionsruntime.md) > [parallel](./cucumber.irunoptionsruntime.parallel.md)
-
-## IRunOptionsRuntime.parallel property
-
-Signature:
-
-```typescript
-parallel: number;
-```
diff --git a/docs/api/cucumber.irunresult.md b/docs/api/cucumber.irunresult.md
deleted file mode 100644
index af36dc92b..000000000
--- a/docs/api/cucumber.irunresult.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunResult](./cucumber.irunresult.md)
-
-## IRunResult interface
-
-Result of a Cucumber test run.
-
-Signature:
-
-```typescript
-export interface IRunResult
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [success](./cucumber.irunresult.success.md) | boolean | Whether the test run was overall successful i.e. no failed scenarios. The exact meaning can vary based on the strict
configuration option. |
-| [support](./cucumber.irunresult.support.md) | ISupportCodeLibrary | The support code library that was used in the test run; can be reused in subsequent runCucumber
calls. |
-
diff --git a/docs/api/cucumber.irunresult.success.md b/docs/api/cucumber.irunresult.success.md
deleted file mode 100644
index cd22c6c17..000000000
--- a/docs/api/cucumber.irunresult.success.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunResult](./cucumber.irunresult.md) > [success](./cucumber.irunresult.success.md)
-
-## IRunResult.success property
-
-Whether the test run was overall successful i.e. no failed scenarios. The exact meaning can vary based on the `strict` configuration option.
-
-Signature:
-
-```typescript
-success: boolean;
-```
diff --git a/docs/api/cucumber.irunresult.support.md b/docs/api/cucumber.irunresult.support.md
deleted file mode 100644
index df5bb64e1..000000000
--- a/docs/api/cucumber.irunresult.support.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [IRunResult](./cucumber.irunresult.md) > [support](./cucumber.irunresult.support.md)
-
-## IRunResult.support property
-
-The support code library that was used in the test run; can be reused in subsequent `runCucumber` calls.
-
-Signature:
-
-```typescript
-support: ISupportCodeLibrary;
-```
diff --git a/docs/api/cucumber.isourcescoordinates.defaultdialect.md b/docs/api/cucumber.isourcescoordinates.defaultdialect.md
deleted file mode 100644
index 8e0e43211..000000000
--- a/docs/api/cucumber.isourcescoordinates.defaultdialect.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesCoordinates](./cucumber.isourcescoordinates.md) > [defaultDialect](./cucumber.isourcescoordinates.defaultdialect.md)
-
-## ISourcesCoordinates.defaultDialect property
-
-Signature:
-
-```typescript
-defaultDialect: string;
-```
diff --git a/docs/api/cucumber.isourcescoordinates.md b/docs/api/cucumber.isourcescoordinates.md
deleted file mode 100644
index d7bfe8005..000000000
--- a/docs/api/cucumber.isourcescoordinates.md
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesCoordinates](./cucumber.isourcescoordinates.md)
-
-## ISourcesCoordinates interface
-
-
-Signature:
-
-```typescript
-export interface ISourcesCoordinates
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [defaultDialect](./cucumber.isourcescoordinates.defaultdialect.md) | string | |
-| [names](./cucumber.isourcescoordinates.names.md) | string\[\] | |
-| [order](./cucumber.isourcescoordinates.order.md) | PickleOrder | |
-| [paths](./cucumber.isourcescoordinates.paths.md) | string\[\] | |
-| [tagExpression](./cucumber.isourcescoordinates.tagexpression.md) | string | |
-
diff --git a/docs/api/cucumber.isourcescoordinates.names.md b/docs/api/cucumber.isourcescoordinates.names.md
deleted file mode 100644
index 756541844..000000000
--- a/docs/api/cucumber.isourcescoordinates.names.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesCoordinates](./cucumber.isourcescoordinates.md) > [names](./cucumber.isourcescoordinates.names.md)
-
-## ISourcesCoordinates.names property
-
-Signature:
-
-```typescript
-names: string[];
-```
diff --git a/docs/api/cucumber.isourcescoordinates.order.md b/docs/api/cucumber.isourcescoordinates.order.md
deleted file mode 100644
index 2c669710a..000000000
--- a/docs/api/cucumber.isourcescoordinates.order.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesCoordinates](./cucumber.isourcescoordinates.md) > [order](./cucumber.isourcescoordinates.order.md)
-
-## ISourcesCoordinates.order property
-
-Signature:
-
-```typescript
-order: PickleOrder;
-```
diff --git a/docs/api/cucumber.isourcescoordinates.paths.md b/docs/api/cucumber.isourcescoordinates.paths.md
deleted file mode 100644
index 0a2143a5a..000000000
--- a/docs/api/cucumber.isourcescoordinates.paths.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesCoordinates](./cucumber.isourcescoordinates.md) > [paths](./cucumber.isourcescoordinates.paths.md)
-
-## ISourcesCoordinates.paths property
-
-Signature:
-
-```typescript
-paths: string[];
-```
diff --git a/docs/api/cucumber.isourcescoordinates.tagexpression.md b/docs/api/cucumber.isourcescoordinates.tagexpression.md
deleted file mode 100644
index 311775818..000000000
--- a/docs/api/cucumber.isourcescoordinates.tagexpression.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesCoordinates](./cucumber.isourcescoordinates.md) > [tagExpression](./cucumber.isourcescoordinates.tagexpression.md)
-
-## ISourcesCoordinates.tagExpression property
-
-Signature:
-
-```typescript
-tagExpression: string;
-```
diff --git a/docs/api/cucumber.isourceserror.location.md b/docs/api/cucumber.isourceserror.location.md
deleted file mode 100644
index eb37941cd..000000000
--- a/docs/api/cucumber.isourceserror.location.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesError](./cucumber.isourceserror.md) > [location](./cucumber.isourceserror.location.md)
-
-## ISourcesError.location property
-
-Signature:
-
-```typescript
-location: {
- line: number;
- column?: number;
- };
-```
diff --git a/docs/api/cucumber.isourceserror.md b/docs/api/cucumber.isourceserror.md
deleted file mode 100644
index 7e5f4fc3a..000000000
--- a/docs/api/cucumber.isourceserror.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesError](./cucumber.isourceserror.md)
-
-## ISourcesError interface
-
-
-Signature:
-
-```typescript
-export interface ISourcesError
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [location](./cucumber.isourceserror.location.md) | { line: number; column?: number; } | |
-| [message](./cucumber.isourceserror.message.md) | string | |
-| [uri](./cucumber.isourceserror.uri.md) | string | |
-
diff --git a/docs/api/cucumber.isourceserror.message.md b/docs/api/cucumber.isourceserror.message.md
deleted file mode 100644
index 42962131e..000000000
--- a/docs/api/cucumber.isourceserror.message.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesError](./cucumber.isourceserror.md) > [message](./cucumber.isourceserror.message.md)
-
-## ISourcesError.message property
-
-Signature:
-
-```typescript
-message: string;
-```
diff --git a/docs/api/cucumber.isourceserror.uri.md b/docs/api/cucumber.isourceserror.uri.md
deleted file mode 100644
index 5a27920dc..000000000
--- a/docs/api/cucumber.isourceserror.uri.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISourcesError](./cucumber.isourceserror.md) > [uri](./cucumber.isourceserror.uri.md)
-
-## ISourcesError.uri property
-
-Signature:
-
-```typescript
-uri: string;
-```
diff --git a/docs/api/cucumber.isupportcodecoordinates.importpaths.md b/docs/api/cucumber.isupportcodecoordinates.importpaths.md
deleted file mode 100644
index 34e8034de..000000000
--- a/docs/api/cucumber.isupportcodecoordinates.importpaths.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) > [importPaths](./cucumber.isupportcodecoordinates.importpaths.md)
-
-## ISupportCodeCoordinates.importPaths property
-
-Signature:
-
-```typescript
-importPaths: string[];
-```
diff --git a/docs/api/cucumber.isupportcodecoordinates.md b/docs/api/cucumber.isupportcodecoordinates.md
deleted file mode 100644
index 87ab944c5..000000000
--- a/docs/api/cucumber.isupportcodecoordinates.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md)
-
-## ISupportCodeCoordinates interface
-
-
-Signature:
-
-```typescript
-export interface ISupportCodeCoordinates
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [importPaths](./cucumber.isupportcodecoordinates.importpaths.md) | string\[\] | |
-| [requireModules](./cucumber.isupportcodecoordinates.requiremodules.md) | string\[\] | |
-| [requirePaths](./cucumber.isupportcodecoordinates.requirepaths.md) | string\[\] | |
-
diff --git a/docs/api/cucumber.isupportcodecoordinates.requiremodules.md b/docs/api/cucumber.isupportcodecoordinates.requiremodules.md
deleted file mode 100644
index f4bac3175..000000000
--- a/docs/api/cucumber.isupportcodecoordinates.requiremodules.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) > [requireModules](./cucumber.isupportcodecoordinates.requiremodules.md)
-
-## ISupportCodeCoordinates.requireModules property
-
-Signature:
-
-```typescript
-requireModules: string[];
-```
diff --git a/docs/api/cucumber.isupportcodecoordinates.requirepaths.md b/docs/api/cucumber.isupportcodecoordinates.requirepaths.md
deleted file mode 100644
index 4ac57b619..000000000
--- a/docs/api/cucumber.isupportcodecoordinates.requirepaths.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) > [requirePaths](./cucumber.isupportcodecoordinates.requirepaths.md)
-
-## ISupportCodeCoordinates.requirePaths property
-
-Signature:
-
-```typescript
-requirePaths: string[];
-```
diff --git a/docs/api/cucumber.isupportcodecoordinatesorlibrary.md b/docs/api/cucumber.isupportcodecoordinatesorlibrary.md
deleted file mode 100644
index ba6d1c040..000000000
--- a/docs/api/cucumber.isupportcodecoordinatesorlibrary.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [ISupportCodeCoordinatesOrLibrary](./cucumber.isupportcodecoordinatesorlibrary.md)
-
-## ISupportCodeCoordinatesOrLibrary type
-
-
-Signature:
-
-```typescript
-export declare type ISupportCodeCoordinatesOrLibrary = ISupportCodeCoordinates | ISupportCodeLibrary;
-```
-References: [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md)
-
diff --git a/docs/api/cucumber.loadconfiguration.md b/docs/api/cucumber.loadconfiguration.md
deleted file mode 100644
index eaaeec41c..000000000
--- a/docs/api/cucumber.loadconfiguration.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [loadConfiguration](./cucumber.loadconfiguration.md)
-
-## loadConfiguration() function
-
-Load user-authored configuration to be used in a test run.
-
-Signature:
-
-```typescript
-export declare function loadConfiguration(options?: ILoadConfigurationOptions, environment?: IRunEnvironment): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| options | [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) | Coordinates required to find configuration. |
-| environment | [IRunEnvironment](./cucumber.irunenvironment.md) | Project environment. |
-
-Returns:
-
-Promise<[IResolvedConfiguration](./cucumber.iresolvedconfiguration.md)>
-
diff --git a/docs/api/cucumber.loadsources.md b/docs/api/cucumber.loadsources.md
deleted file mode 100644
index 884c7edfb..000000000
--- a/docs/api/cucumber.loadsources.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [loadSources](./cucumber.loadsources.md)
-
-## loadSources() function
-
-Load and parse features, produce a filtered and ordered test plan and/or parse errors.
-
-Signature:
-
-```typescript
-export declare function loadSources(coordinates: ISourcesCoordinates, environment?: IRunEnvironment): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| coordinates | [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | Coordinates required to find features |
-| environment | [IRunEnvironment](./cucumber.irunenvironment.md) | Project environment. |
-
-Returns:
-
-Promise<[ILoadSourcesResult](./cucumber.iloadsourcesresult.md)>
-
diff --git a/docs/api/cucumber.loadsupport.md b/docs/api/cucumber.loadsupport.md
deleted file mode 100644
index 95dd95025..000000000
--- a/docs/api/cucumber.loadsupport.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [loadSupport](./cucumber.loadsupport.md)
-
-## loadSupport() function
-
-Load support code for use in test runs.
-
-Signature:
-
-```typescript
-export declare function loadSupport(options: ILoadSupportOptions, environment?: IRunEnvironment): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| options | [ILoadSupportOptions](./cucumber.iloadsupportoptions.md) | Subset of IRunnableConfiguration
required to find the support code. |
-| environment | [IRunEnvironment](./cucumber.irunenvironment.md) | Project environment. |
-
-Returns:
-
-Promise<ISupportCodeLibrary>
-
diff --git a/docs/api/cucumber.md b/docs/api/cucumber.md
deleted file mode 100644
index afd0e5813..000000000
--- a/docs/api/cucumber.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md)
-
-## cucumber package
-
-Cucumber for JavaScript
-
-## Remarks
-
-These docs cover the API used for running Cucumber programmatically. The entry point is `@cucumber/cucumber/api`.
-
-## Functions
-
-| Function | Description |
-| --- | --- |
-| [loadConfiguration(options, environment)](./cucumber.loadconfiguration.md) | Load user-authored configuration to be used in a test run. |
-| [loadSources(coordinates, environment)](./cucumber.loadsources.md) | Load and parse features, produce a filtered and ordered test plan and/or parse errors. |
-| [loadSupport(options, environment)](./cucumber.loadsupport.md) | Load support code for use in test runs. |
-| [runCucumber(configuration, environment, onMessage)](./cucumber.runcucumber.md) | Execute a Cucumber test run. |
-
-## Interfaces
-
-| Interface | Description |
-| --- | --- |
-| [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) | |
-| [ILoadSourcesResult](./cucumber.iloadsourcesresult.md) | |
-| [ILoadSupportOptions](./cucumber.iloadsupportoptions.md) | |
-| [IPlannedPickle](./cucumber.iplannedpickle.md) | |
-| [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md) | |
-| [IRunConfiguration](./cucumber.irunconfiguration.md) | |
-| [IRunEnvironment](./cucumber.irunenvironment.md) | Contextual data about the project environment. |
-| [IRunOptions](./cucumber.irunoptions.md) | |
-| [IRunOptionsFormats](./cucumber.irunoptionsformats.md) | |
-| [IRunOptionsRuntime](./cucumber.irunoptionsruntime.md) | |
-| [IRunResult](./cucumber.irunresult.md) | Result of a Cucumber test run. |
-| [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | |
-| [ISourcesError](./cucumber.isourceserror.md) | |
-| [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) | |
-
-## Type Aliases
-
-| Type Alias | Description |
-| --- | --- |
-| [ISupportCodeCoordinatesOrLibrary](./cucumber.isupportcodecoordinatesorlibrary.md) | |
-
diff --git a/docs/api/cucumber.runcucumber.md b/docs/api/cucumber.runcucumber.md
deleted file mode 100644
index dc444056e..000000000
--- a/docs/api/cucumber.runcucumber.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-[Home](./index.md) > [@cucumber/cucumber](./cucumber.md) > [runCucumber](./cucumber.runcucumber.md)
-
-## runCucumber() function
-
-Execute a Cucumber test run.
-
-Signature:
-
-```typescript
-export declare function runCucumber(configuration: IRunOptions, environment?: IRunEnvironment, onMessage?: (message: Envelope) => void): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| configuration | [IRunOptions](./cucumber.irunoptions.md) | Configuration loaded from loadConfiguration
. |
-| environment | [IRunEnvironment](./cucumber.irunenvironment.md) | Project environment. |
-| onMessage | (message: Envelope) => void | Callback fired each time Cucumber emits a message. |
-
-Returns:
-
-Promise<[IRunResult](./cucumber.irunresult.md)>
-
diff --git a/docs/api/index.md b/docs/api/index.md
deleted file mode 100644
index eddac6dd2..000000000
--- a/docs/api/index.md
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-[Home](./index.md)
-
-## API Reference
-
-## Packages
-
-| Package | Description |
-| --- | --- |
-| [@cucumber/cucumber](./cucumber.md) | Cucumber for JavaScript |
-
diff --git a/docs/configuration.md b/docs/configuration.md
index 8a3ceae84..90e7afa96 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -90,7 +90,7 @@ These options can be used in a configuration file (see [above](#files)) or on th
| `import` | `string[]` | Yes | `--import`, `-i` | Paths to where your support code is | [] |
| `language` | `string` | No | `--language` | Default language for your feature files | en |
| `name` | `string` | No | `--name` | Regular expressions of which scenario names should match one of to be run - see [Filtering](./filtering.md#names) | [] |
-| `order` | `string` | No | `--order` | Run in the order defined, or in a random order | defined |
+| `order` | `string` | No | `--order` | Run in the order defined, or in a random order - see [Filtering and Ordering](./filtering.md#order) | defined |
| `parallel` | `number` | No | `--parallel` | Run tests in parallel with the given number of worker processes - see [Parallel](./parallel.md) | 0 |
| `publish` | `boolean` | No | `--publish` | Publish a report of your test run to | false |
| `require` | `string[]` | Yes | `--require`, `-r` | Paths to where your support code is, for CommonJS - see [below](#finding-your-code) | [] |
diff --git a/docs/filtering.md b/docs/filtering.md
index 9200f6014..e924ff68a 100644
--- a/docs/filtering.md
+++ b/docs/filtering.md
@@ -1,4 +1,4 @@
-# Filtering
+# Filtering and Ordering
You can use a few different configurations to have Cucumber filter which scenarios are run. This can be useful when you want to focus on a small subset of scenarios when developing or debugging.
@@ -35,3 +35,14 @@ You can specify a [Cucumber tag expression](https://docs.cucumber.io/cucumber/ap
- On the CLI `$ cucumber-js --tags "@foo or @bar"`
This option is repeatable, so you can provide several expressions and they'll be combined with an `and` operator, meaning a scenario needs to match all of them.
+
+## Order
+
+You can specify the order that scenarios should run in:
+
+- In a configuration file `{ order: 'defined' }`
+- On the CLI `$ cucumber-js --order defined`
+
+The default is `defined` where scenarios are run in the order they are discovered in. This roughly means alphabetical order of file path followed by sequential order within each file, although if you pass multiple globs/paths to the `paths` option this order will be honoured.
+
+You can also specify `random` to shuffle the scenarios randomly, and optionally specify a seed like `random:234119`.
diff --git a/docs/formatters.md b/docs/formatters.md
index d56e840ad..42e5ea657 100644
--- a/docs/formatters.md
+++ b/docs/formatters.md
@@ -13,10 +13,10 @@ For each format you specify, you have to provide one or two values. The first (r
* The name of one of the built-in formatters (below) e.g. `progress-bar`
* A module/package name e.g. `@cucumber/pretty-formatter`
-* A relative path to a local formatter implementation e.g. `./my-customer-formatter.js`
+* A relative path to a local formatter implementation e.g. `./my-custom-formatter.js`
* An absolute path to a local formatter implementation in the form of a `file://` URL
-Without a second value, the formatter will print to `stdout`. The second value, if present, is a path to where the formatter output should be written. If the path includes directories that do not yet exist, they will be created.
+Without a second value, the formatter will print to `stdout`. The second value, if present, is a path to where the formatter output should be written. If the path includes directories that don't exist yet, they'll be created automatically.
On the CLI, when specifying both a name and path, you'll need to use `:` as a delimiter and wrap each side of it with double quotes. In a configuration file you can do this too, but you can also provide an array with the two values as separate strings, which is recommended.
diff --git a/docs/javascript_api.md b/docs/javascript_api.md
index 4873b1b85..559e9d038 100644
--- a/docs/javascript_api.md
+++ b/docs/javascript_api.md
@@ -1,51 +1,165 @@
# JavaScript API
-You can run Cucumber programmatically via its JavaScript API. This isn't something most users would need to do, but if you have a niche use case or need to work Cucumber into a bigger framework, it might be what you need. The API allows you to load configuration, sources and support code and execute test runs with async functions and within the current process.
+You can run Cucumber programmatically via its JavaScript API. This isn't something most users would need to do, but if you have a niche use case or need to work Cucumber into a bigger framework, it might be what you need. The API allows you to load configuration, sources and support code and execute test runs via async functions and within the current process.
The API is available on its own entry point `@cucumber/cucumber/api`.
-There are some examples below, and [reference documentation](./api/index.md) for everything available.
+## Reference documentation
-## Simple example
+You can find full reference documentation for this module at
+
+
+## Minimal example
```javascript
import { loadConfiguration, runCucumber } from '@cucumber/cucumber/api'
-export async function runTests() {
- const { runConfiguration } = await loadConfiguration()
- const { success } = await runCucumber(runConfiguration)
- return success
+const { runConfiguration } = await loadConfiguration()
+const { success } = await runCucumber(runConfiguration)
+console.log(success)
+```
+
+## Concepts
+
+### Environment
+
+`runCucumber` and the other functions in this module all accept an `environment` argument. It consists of:
+
+- `cwd`
+- `stdout`
+- `stderr`
+- `env`
+- `debug`
+
+These influence a lot of core behaviour, like where we start looking for files and where output is written. Often, though, the default values (from `process`) are going to be fine. As such, you can omit any of these values, or the entire object, and Cucumber will just fill the gaps with the defaults.
+
+### Configuration
+
+Configuration for running Cucumber consists of various options. It can take two different shapes, which each make sense at different points in the lifecycle for different reasons.
+
+#### "User" configuration
+
+A simple, flat format. This is how configuration is expressed by users in configuration files and on the CLI. Users can provide a partial configuration and any gaps are filled with defaults, but here's a filled-out example:
+
+```json
+{
+ "backtrace": true,
+ "dryRun": false,
+ "forceExit": false,
+ "failFast": true,
+ "format": [
+ "progress-bar",
+ ["html", "./reports/cucumber.html"]
+ ],
+ "formatOptions": {},
+ "import": ["features/support/**/*.js"],
+ "language": "en",
+ "name": [],
+ "order": "defined",
+ "paths": ["features/**/*.feature"],
+ "parallel": 3,
+ "publish": false,
+ "publishQuiet": false,
+ "require": [],
+ "requireModule": [],
+ "retry": 2,
+ "retryTagFilter": "@flaky",
+ "strict": true,
+ "tags": "@interesting",
+ "worldParameters": {}
}
```
-## Complex example
+#### "Run" configuration
-```javascript
-import { loadConfiguration, loadSupport, runCucumber } from '@cucumber/cucumber/api'
+A more structured format with several distinct blocks. You might notice it contains more or less the same data, but in a shape that's more useful for `runCucumber`, which accepts this as its options argument. Also, everything is required. Here's the equivalent to the "user" configuration example:
-export async function runTests(directory, configFile, failFast) {
- // things we need to specify about the environment
- const environment = { cwd: directory }
- // load configuration from a particular file, and override a specific option
- const { runConfiguration } = await loadConfiguration({ file: configFile, provided: { failFast } }, environment)
- // load the support code upfront
- const support = await loadSupport(runConfiguration, environment)
- // run cucumber, using the support code we loaded already
- const { success } = await runCucumber({ ...runConfiguration, support }, environment)
- return success
+```json
+{
+ "sources": {
+ "defaultDialect": "en",
+ "paths": [
+ "features/**/*.feature"
+ ],
+ "name": [],
+ "tagExpression": "@interesting",
+ "order": "defined"
+ },
+ "support": {
+ "importPaths": [
+ "features/support/**/*.js"
+ ],
+ "requireModules": [],
+ "requirePaths": []
+ },
+ "formats": {
+ "files": {
+ "./reports/cucumber.html": "html"
+ },
+ "options": {},
+ "publish": false,
+ "stdout": "progress-bar"
+ },
+ "runtime": {
+ "dryRun": false,
+ "failFast": true,
+ "filterStacktraces": false,
+ "parallel": 3,
+ "retry": 2,
+ "retryTagFilter": "@flaky",
+ "strict": true,
+ "worldParameters": {}
+ }
}
```
-## Sources example
+Having this structure for `runCucumber` has some advantages:
+
+- It represents a separation of concerns between modules of the codebase that deal with different aspects of the lifecycle
+- It allows some blocks to be replaced with other values that achieve the same thing (see [Preloading and reusing support code](#preloading-and-reusing-support-code) below)
+- It allows a subset of some blocks to be used for other supporting functions (see [Calculating a test plan](#calculating-a-test-plan) below)
+
+### Using configuration in practise
+
+Whilst you need a fully-filled "run" configuration object to call `runCucumber` and friends, it's a bit tedious to hand-author. The recommended pattern is to use `loadConfiguration` to resolve this for you, merging together the defaults, user-authored configuration file, and any extra values you want to provide.
+
+## More examples
+
+### Calculating a test plan
You can use the `loadSources` function to load and parse your feature files, calculate the test plan (accounting for filtering and ordering) and report any parse errors:
```javascript
import { loadConfiguration, loadSources } from '@cucumber/cucumber/api'
-export async function calculatePlan() {
- const { runConfiguration } = await loadConfiguration()
- const { plan } = await loadSources(runConfiguration.sources)
- return plan
-}
+const { runConfiguration } = await loadConfiguration()
+const { plan } = await loadSources(runConfiguration.sources)
+console.dir(plan)
+```
+
+### Preloading and reusing support code
+
+If you want to multiple test runs in the same process, you need to reuse the same support library across the runs. This is because your code is cached by Node.js the first time it's imported, and subsequent imports won't cause your calls to `Given` etc to happen again.
+
+You can use the `loadSupport` function to load the support code library once upfront, and pass that into `runCucumber` as many times as you want in place of the `support` part of the options object:
+
+```javascript
+import { loadConfiguration, loadSupport, runCucumber } from '@cucumber/cucumber/api'
+
+const { runConfiguration } = await loadConfiguration()
+const support = await loadSupport(runConfiguration)
+const result1 = await runCucumber({ ...runConfiguration, support })
+const result2 = await runCucumber({ ...runConfiguration, support })
+const result3 = await runCucumber({ ...runConfiguration, support })
+```
+
+Similarly, each result from `runCucumber` includes the support code library that was used, so you can just grab that from your first run and reuse it in subsequent runs, if that suits your flow better:
+
+```javascript
+import { loadConfiguration, loadSupport, runCucumber } from '@cucumber/cucumber/api'
+
+const { runConfiguration } = await loadConfiguration()
+const { support, ...result1 } = await runCucumber(runConfiguration)
+const result2 = await runCucumber({ ...runConfiguration, support })
+const result3 = await runCucumber({ ...runConfiguration, support })
```
diff --git a/api-extractor.json b/exports/api/api-extractor.json
similarity index 57%
rename from api-extractor.json
rename to exports/api/api-extractor.json
index d10a0f372..c490a93cb 100644
--- a/api-extractor.json
+++ b/exports/api/api-extractor.json
@@ -4,12 +4,12 @@
"compiler": {},
"apiReport": {
"enabled": true,
- "reportFolder": "/reports/",
- "reportTempFolder": "/tmp/api-extractor/"
+ "reportFolder": "/exports/api/",
+ "reportTempFolder": "/exports/api/tmp",
+ "reportFileName": "report.api.md"
},
"docModel": {
- "enabled": true,
- "apiJsonFilePath": "/tmp/api-extractor/.api.json"
+ "enabled": false
},
"dtsRollup": {
"enabled": false
@@ -17,6 +17,12 @@
"messages": {
"extractorMessageReporting": {
"ae-forgotten-export": {
+ "logLevel": "warning",
+ "addToApiReportFile": false
+ }
+ },
+ "tsdocMessageReporting": {
+ "tsdoc-undefined-tag": {
"logLevel": "none"
}
}
diff --git a/reports/cucumber.api.md b/exports/api/report.api.md
similarity index 55%
rename from reports/cucumber.api.md
rename to exports/api/report.api.md
index 1d99b74a2..585c4e978 100644
--- a/reports/cucumber.api.md
+++ b/exports/api/report.api.md
@@ -7,32 +7,49 @@
///
import { Envelope } from '@cucumber/messages';
-import { Expression } from '@cucumber/cucumber-expressions';
-import http from 'http';
-import * as messages from '@cucumber/messages';
-import { ParameterTypeRegistry } from '@cucumber/cucumber-expressions';
-import { PassThrough } from 'stream';
-import { Transform } from 'stream';
-import { WriteStream } from 'fs';
-import { WriteStream as WriteStream_2 } from 'tty';
-
-// @public (undocumented)
+import { JsonObject } from 'type-fest';
+import { Writable } from 'node:stream';
+
+// @public
+export interface IConfiguration {
+ backtrace: boolean;
+ dryRun: boolean;
+ failFast: boolean;
+ forceExit: boolean;
+ format: Array;
+ formatOptions: JsonObject;
+ import: string[];
+ language: string;
+ name: string[];
+ order: IPickleOrder;
+ parallel: number;
+ paths: string[];
+ publish: boolean;
+ // @deprecated (undocumented)
+ publishQuiet: boolean;
+ require: string[];
+ requireModule: string[];
+ retry: number;
+ retryTagFilter: string;
+ strict: boolean;
+ tags: string;
+ worldParameters: JsonObject;
+}
+
+// @public
export interface ILoadConfigurationOptions {
- file?: string;
+ file?: string | false;
profiles?: string[];
- // Warning: (ae-forgotten-export) The symbol "IConfiguration" needs to be exported by the entry point index.d.ts
provided?: Partial;
}
-// @public (undocumented)
+// @public
export interface ILoadSourcesResult {
- // (undocumented)
errors: ISourcesError[];
- // (undocumented)
plan: IPlannedPickle[];
}
-// @public (undocumented)
+// @public
export interface ILoadSupportOptions {
// (undocumented)
sources: ISourcesCoordinates;
@@ -40,26 +57,34 @@ export interface ILoadSupportOptions {
support: ISupportCodeCoordinates;
}
-// @public (undocumented)
+// @public
+export type IPickleOrder = 'defined' | 'random' | `random:${string}`;
+
+// @public
export interface IPlannedPickle {
// (undocumented)
location: {
line: number;
column?: number;
};
- // (undocumented)
name: string;
// (undocumented)
uri: string;
}
-// @public (undocumented)
+// @public
+export interface IPublishConfig {
+ token: string;
+ url: string;
+}
+
+// @public
export interface IResolvedConfiguration {
runConfiguration: IRunConfiguration;
useConfiguration: IConfiguration;
}
-// @public (undocumented)
+// @public
export interface IRunConfiguration {
// (undocumented)
formats: IRunOptionsFormats;
@@ -74,13 +99,13 @@ export interface IRunConfiguration {
// @public
export interface IRunEnvironment {
cwd?: string;
+ debug?: boolean;
env?: NodeJS.ProcessEnv;
- stderr?: IFormatterStream;
- // Warning: (ae-forgotten-export) The symbol "IFormatterStream" needs to be exported by the entry point index.d.ts
- stdout?: IFormatterStream;
+ stderr?: Writable;
+ stdout?: Writable;
}
-// @public (undocumented)
+// @public
export interface IRunOptions {
// (undocumented)
formats: IRunOptionsFormats;
@@ -92,80 +117,69 @@ export interface IRunOptions {
support: ISupportCodeCoordinatesOrLibrary;
}
-// @public (undocumented)
+// @public
export interface IRunOptionsFormats {
- // (undocumented)
files: Record;
- // Warning: (ae-forgotten-export) The symbol "FormatOptions" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
- options: FormatOptions;
- // (undocumented)
- publish: {
- url?: string;
- token?: string;
- } | false;
- // (undocumented)
+ options: JsonObject;
+ publish: IPublishConfig | false;
stdout: string;
}
-// Warning: (ae-forgotten-export) The symbol "IRuntimeOptions" needs to be exported by the entry point index.d.ts
-//
-// @public (undocumented)
-export interface IRunOptionsRuntime extends IRuntimeOptions {
- // (undocumented)
+// @public
+export interface IRunOptionsRuntime {
+ dryRun: boolean;
+ failFast: boolean;
+ filterStacktraces: boolean;
parallel: number;
+ retry: number;
+ retryTagFilter: string;
+ strict: boolean;
+ worldParameters: JsonObject;
}
// @public
export interface IRunResult {
success: boolean;
- // Warning: (ae-forgotten-export) The symbol "ISupportCodeLibrary" needs to be exported by the entry point index.d.ts
support: ISupportCodeLibrary;
}
-// @public (undocumented)
+// @public
export interface ISourcesCoordinates {
- // (undocumented)
defaultDialect: string;
- // (undocumented)
names: string[];
- // Warning: (ae-forgotten-export) The symbol "PickleOrder" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
- order: PickleOrder;
- // (undocumented)
+ order: IPickleOrder;
paths: string[];
- // (undocumented)
tagExpression: string;
}
-// @public (undocumented)
+// @public
export interface ISourcesError {
// (undocumented)
location: {
line: number;
column?: number;
};
- // (undocumented)
message: string;
// (undocumented)
uri: string;
}
-// @public (undocumented)
+// @public
export interface ISupportCodeCoordinates {
- // (undocumented)
importPaths: string[];
- // (undocumented)
requireModules: string[];
- // (undocumented)
requirePaths: string[];
}
-// @public (undocumented)
+// @public
export type ISupportCodeCoordinatesOrLibrary = ISupportCodeCoordinates | ISupportCodeLibrary;
+// @public
+export interface ISupportCodeLibrary {
+ // (undocumented)
+ readonly originalCoordinates: ISupportCodeCoordinates;
+}
+
// @public
export function loadConfiguration(options?: ILoadConfigurationOptions, environment?: IRunEnvironment): Promise;
@@ -176,6 +190,6 @@ export function loadSources(coordinates: ISourcesCoordinates, environment?: IRun
export function loadSupport(options: ILoadSupportOptions, environment?: IRunEnvironment): Promise;
// @public
-export function runCucumber(configuration: IRunOptions, environment?: IRunEnvironment, onMessage?: (message: Envelope) => void): Promise;
+export function runCucumber(options: IRunOptions, environment?: IRunEnvironment, onMessage?: (message: Envelope) => void): Promise;
```
diff --git a/exports/root/api-extractor.json b/exports/root/api-extractor.json
new file mode 100644
index 000000000..894823c82
--- /dev/null
+++ b/exports/root/api-extractor.json
@@ -0,0 +1,33 @@
+{
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
+ "mainEntryPointFilePath": "/lib/index.d.ts",
+ "compiler": {},
+ "apiReport": {
+ "enabled": true,
+ "reportFolder": "/exports/root/",
+ "reportTempFolder": "/exports/root/tmp",
+ "reportFileName": "report.api.md"
+ },
+ "docModel": {
+ "enabled": false
+ },
+ "dtsRollup": {
+ "enabled": false
+ },
+ "messages": {
+ "extractorMessageReporting": {
+ "ae-forgotten-export": {
+ "logLevel": "none",
+ "addToApiReportFile": false
+ },
+ "ae-missing-release-tag": {
+ "logLevel": "none"
+ }
+ },
+ "tsdocMessageReporting": {
+ "tsdoc-undefined-tag": {
+ "logLevel": "none"
+ }
+ }
+ }
+}
diff --git a/exports/root/report.api.md b/exports/root/report.api.md
new file mode 100644
index 000000000..546082cda
--- /dev/null
+++ b/exports/root/report.api.md
@@ -0,0 +1,537 @@
+## API Report File for "@cucumber/cucumber"
+
+> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
+
+```ts
+
+///
+
+import { EventEmitter } from 'node:events';
+import { Expression } from '@cucumber/cucumber-expressions';
+import { GeneratedExpression } from '@cucumber/cucumber-expressions';
+import { IDefineStep as IDefineStep_2 } from './support_code_library_builder/types';
+import { IDefineTestCaseHookOptions as IDefineTestCaseHookOptions_2 } from './support_code_library_builder/types';
+import { IDefineTestRunHookOptions as IDefineTestRunHookOptions_2 } from './support_code_library_builder/types';
+import { IDefineTestStepHookOptions as IDefineTestStepHookOptions_2 } from './support_code_library_builder/types';
+import { IdGenerator } from '@cucumber/messages';
+import { IParameterTypeDefinition as IParameterTypeDefinition_2 } from './support_code_library_builder/types';
+import { IWorld as IWorld_2 } from './support_code_library_builder/world';
+import { JsonObject } from 'type-fest';
+import * as messages from '@cucumber/messages';
+import { ParallelAssignmentValidator as ParallelAssignmentValidator_2 } from './support_code_library_builder/types';
+import { ParameterType } from '@cucumber/cucumber-expressions';
+import { ParameterTypeRegistry } from '@cucumber/cucumber-expressions';
+import { Readable } from 'node:stream';
+import { TestCaseHookFunction as TestCaseHookFunction_2 } from './support_code_library_builder/types';
+import { TestRunHookFunction as TestRunHookFunction_2 } from './support_code_library_builder/types';
+import { TestStepHookFunction as TestStepHookFunction_2 } from './support_code_library_builder/types';
+import { TestStepResultStatus } from '@cucumber/messages';
+import { Writable } from 'node:stream';
+
+// @public (undocumented)
+export const After: (>(code: TestCaseHookFunction_2) => void) & (>(tags: string, code: TestCaseHookFunction_2) => void) & (>(options: IDefineTestCaseHookOptions_2, code: TestCaseHookFunction_2) => void);
+
+// @public (undocumented)
+export const AfterAll: ((code: TestRunHookFunction_2) => void) & ((options: IDefineTestRunHookOptions_2, code: TestRunHookFunction_2) => void);
+
+// @public (undocumented)
+export const AfterStep: (>(code: TestStepHookFunction_2) => void) & (>(tags: string, code: TestStepHookFunction_2) => void) & (>(options: IDefineTestStepHookOptions_2, code: TestStepHookFunction_2) => void);
+
+// @public (undocumented)
+function atMostOnePicklePerTag(tagNames: string[]): ParallelAssignmentValidator;
+
+// @public (undocumented)
+export const Before: (>(code: TestCaseHookFunction_2) => void) & (>(tags: string, code: TestCaseHookFunction_2) => void) & (>(options: IDefineTestCaseHookOptions_2, code: TestCaseHookFunction_2) => void);
+
+// @public (undocumented)
+export const BeforeAll: ((code: TestRunHookFunction_2) => void) & ((options: IDefineTestRunHookOptions_2, code: TestRunHookFunction_2) => void);
+
+// @public (undocumented)
+export const BeforeStep: (>(code: TestStepHookFunction_2) => void) & (>(tags: string, code: TestStepHookFunction_2) => void) & (>(options: IDefineTestStepHookOptions_2, code: TestStepHookFunction_2) => void);
+
+// @public @deprecated (undocumented)
+export const Cli: typeof Cli_2;
+
+// @public (undocumented)
+export class DataTable {
+ constructor(sourceTable: messages.PickleTable | string[][]);
+ // (undocumented)
+ hashes(): Record[];
+ // (undocumented)
+ raw(): string[][];
+ // (undocumented)
+ rows(): string[][];
+ // (undocumented)
+ rowsHash(): Record;
+ // (undocumented)
+ transpose(): DataTable;
+}
+
+// @public (undocumented)
+export const defineParameterType: (options: IParameterTypeDefinition_2) => void;
+
+// @public (undocumented)
+export const defineStep: IDefineStep_2;
+
+// @public (undocumented)
+class EventDataCollector {
+ constructor(eventBroadcaster: EventEmitter);
+ // (undocumented)
+ getGherkinDocument(uri: string): messages.GherkinDocument;
+ // (undocumented)
+ getPickle(pickleId: string): messages.Pickle;
+ // (undocumented)
+ getTestCaseAttempt(testCaseStartedId: string): ITestCaseAttempt;
+ // (undocumented)
+ getTestCaseAttempts(): ITestCaseAttempt[];
+ // (undocumented)
+ parseEnvelope(envelope: messages.Envelope): void;
+ // (undocumented)
+ storeAttachment(attachment: messages.Attachment): void;
+ // (undocumented)
+ storeTestCaseResult({ testCaseStartedId, willBeRetried, }: messages.TestCaseFinished): void;
+ // (undocumented)
+ storeTestStepResult({ testCaseStartedId, testStepId, testStepResult, }: messages.TestStepFinished): void;
+ // (undocumented)
+ readonly undefinedParameterTypes: messages.UndefinedParameterType[];
+}
+
+// @public (undocumented)
+function formatIssue({ colorFns, number, snippetBuilder, testCaseAttempt, supportCodeLibrary, printAttachments, }: IFormatIssueRequest): string;
+
+// @public (undocumented)
+function formatLocation(obj: ILineAndUri, cwd?: string): string;
+
+// @public (undocumented)
+function formatSummary({ colorFns, testCaseAttempts, testRunDuration, }: IFormatSummaryRequest): string;
+
+// @public (undocumented)
+export class Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ protected colorFns: IColorFns;
+ // (undocumented)
+ protected cwd: string;
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ protected eventDataCollector: EventDataCollector;
+ // (undocumented)
+ finished(): Promise;
+ // (undocumented)
+ protected log: IFormatterLogFn;
+ // (undocumented)
+ protected printAttachments: boolean;
+ // (undocumented)
+ protected snippetBuilder: StepDefinitionSnippetBuilder;
+ // (undocumented)
+ protected stream: Writable;
+ // (undocumented)
+ protected supportCodeLibrary: SupportCodeLibrary;
+}
+
+// @public (undocumented)
+export const FormatterBuilder: {
+ build(type: string, options: IBuildOptions): Promise;
+ getConstructorByType(type: string, cwd: string): Promise;
+ getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }: IGetStepDefinitionSnippetBuilderOptions): Promise;
+ loadCustomClass(type: 'formatter' | 'syntax', descriptor: string, cwd: string): Promise;
+ loadFile(urlOrName: URL | string): Promise;
+ resolveConstructor(ImportedCode: any): any;
+};
+
+declare namespace formatterHelpers {
+ export {
+ parseTestCaseAttempt,
+ EventDataCollector,
+ KeywordType,
+ getStepKeywordType,
+ formatIssue,
+ isWarning,
+ isFailure,
+ isIssue,
+ formatLocation,
+ formatSummary,
+ getUsage,
+ GherkinDocumentParser,
+ PickleParser
+ }
+}
+export { formatterHelpers }
+
+// @public (undocumented)
+function getGherkinExampleRuleMap(gherkinDocument: messages.GherkinDocument): Record;
+
+// @public (undocumented)
+function getGherkinScenarioLocationMap(gherkinDocument: messages.GherkinDocument): Record;
+
+// @public (undocumented)
+function getGherkinScenarioMap(gherkinDocument: messages.GherkinDocument): Record;
+
+// @public (undocumented)
+function getGherkinStepMap(gherkinDocument: messages.GherkinDocument): Record;
+
+// @public (undocumented)
+function getPickleLocation({ gherkinDocument, pickle, }: IGetPickleLocationRequest): messages.Location;
+
+// @public (undocumented)
+function getPickleStepMap(pickle: messages.Pickle): Record;
+
+// @public (undocumented)
+function getScenarioDescription({ pickle, gherkinScenarioMap, }: IGetScenarioDescriptionRequest): string;
+
+// @public (undocumented)
+function getStepKeyword({ pickleStep, gherkinStepMap, }: IGetStepKeywordRequest): string;
+
+// @public (undocumented)
+function getStepKeywordType({ keyword, language, previousKeywordType, }: IGetStepKeywordTypeOptions): KeywordType;
+
+// @public (undocumented)
+function getUsage({ stepDefinitions, eventDataCollector, }: IGetUsageRequest): IUsage[];
+
+declare namespace GherkinDocumentParser {
+ export {
+ getGherkinStepMap,
+ getGherkinScenarioMap,
+ getGherkinExampleRuleMap,
+ getGherkinScenarioLocationMap
+ }
+}
+
+// @public (undocumented)
+export const Given: IDefineStep_2;
+
+// @public (undocumented)
+export interface IFormatterOptions {
+ // (undocumented)
+ cleanup: IFormatterCleanupFn;
+ // (undocumented)
+ colorFns: IColorFns;
+ // (undocumented)
+ cwd: string;
+ // (undocumented)
+ eventBroadcaster: EventEmitter;
+ // (undocumented)
+ eventDataCollector: EventDataCollector;
+ // (undocumented)
+ log: IFormatterLogFn;
+ // (undocumented)
+ parsedArgvOptions: FormatOptions;
+ // (undocumented)
+ snippetBuilder: StepDefinitionSnippetBuilder;
+ // (undocumented)
+ stream: Writable;
+ // (undocumented)
+ supportCodeLibrary: SupportCodeLibrary;
+}
+
+// @public (undocumented)
+interface IGetPickleLocationRequest {
+ // (undocumented)
+ gherkinDocument: messages.GherkinDocument;
+ // (undocumented)
+ pickle: messages.Pickle;
+}
+
+// @public (undocumented)
+interface IGetScenarioDescriptionRequest {
+ // (undocumented)
+ gherkinScenarioMap: Record;
+ // (undocumented)
+ pickle: messages.Pickle;
+}
+
+// @public (undocumented)
+interface IGetStepKeywordRequest {
+ // (undocumented)
+ gherkinStepMap: Record;
+ // (undocumented)
+ pickleStep: messages.PickleStep;
+}
+
+// @public (undocumented)
+export interface INewRuntimeOptions {
+ // (undocumented)
+ eventBroadcaster: EventEmitter;
+ // (undocumented)
+ eventDataCollector: EventDataCollector;
+ // (undocumented)
+ newId: IdGenerator.NewId;
+ // (undocumented)
+ options: IRuntimeOptions;
+ // (undocumented)
+ pickleIds: string[];
+ // (undocumented)
+ supportCodeLibrary: SupportCodeLibrary;
+}
+
+// @public (undocumented)
+export interface IRuntimeOptions {
+ // (undocumented)
+ dryRun: boolean;
+ // (undocumented)
+ failFast: boolean;
+ // (undocumented)
+ filterStacktraces: boolean;
+ // (undocumented)
+ retry: number;
+ // (undocumented)
+ retryTagFilter: string;
+ // (undocumented)
+ strict: boolean;
+ // (undocumented)
+ worldParameters: JsonObject;
+}
+
+// @public (undocumented)
+function isFailure(result: messages.TestStepResult, willBeRetried?: boolean): boolean;
+
+// @public (undocumented)
+function isIssue(result: messages.TestStepResult): boolean;
+
+// @public (undocumented)
+function isWarning(result: messages.TestStepResult, willBeRetried?: boolean): boolean;
+
+// @public (undocumented)
+export interface ITestCaseHookParameter {
+ // (undocumented)
+ gherkinDocument: messages.GherkinDocument;
+ // (undocumented)
+ pickle: messages.Pickle;
+ // (undocumented)
+ result?: messages.TestStepResult;
+ // (undocumented)
+ testCaseStartedId: string;
+ // (undocumented)
+ willBeRetried?: boolean;
+}
+
+// @public (undocumented)
+export interface ITestStepHookParameter {
+ // (undocumented)
+ gherkinDocument: messages.GherkinDocument;
+ // (undocumented)
+ pickle: messages.Pickle;
+ // (undocumented)
+ pickleStep: messages.PickleStep;
+ // (undocumented)
+ result: messages.TestStepResult;
+ // (undocumented)
+ testCaseStartedId: string;
+ // (undocumented)
+ testStepId: string;
+}
+
+// @public (undocumented)
+export interface IWorld {
+ // (undocumented)
+ [key: string]: any;
+ // (undocumented)
+ readonly attach: ICreateAttachment;
+ // (undocumented)
+ readonly log: ICreateLog;
+ // (undocumented)
+ readonly parameters: ParametersType;
+}
+
+// @public (undocumented)
+export interface IWorldOptions {
+ // (undocumented)
+ attach: ICreateAttachment;
+ // (undocumented)
+ log: ICreateLog;
+ // (undocumented)
+ parameters: ParametersType;
+}
+
+// @public (undocumented)
+export class JsonFormatter extends Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ convertNameToId(obj: messages.Feature | messages.Pickle): string;
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ formatDataTable(dataTable: messages.PickleTable): any;
+ // (undocumented)
+ formatDocString(docString: messages.PickleDocString, gherkinStep: messages.Step): any;
+ // (undocumented)
+ formatStepArgument(stepArgument: messages.PickleStepArgument, gherkinStep: messages.Step): any;
+ // (undocumented)
+ getFeatureData({ feature, elements, uri, }: IBuildJsonFeatureOptions): IJsonFeature;
+ // (undocumented)
+ getFeatureTags(feature: messages.Feature): IJsonTag[];
+ // (undocumented)
+ getScenarioData({ feature, gherkinScenarioLocationMap, gherkinExampleRuleMap, gherkinScenarioMap, pickle, steps, }: IBuildJsonScenarioOptions): IJsonScenario;
+ // (undocumented)
+ getScenarioTags({ feature, pickle, gherkinScenarioMap, }: {
+ feature: messages.Feature;
+ pickle: messages.Pickle;
+ gherkinScenarioMap: Record;
+ }): IJsonTag[];
+ // (undocumented)
+ getStepData({ isBeforeHook, gherkinStepMap, pickleStepMap, testStep, testStepAttachments, testStepResult, }: IBuildJsonStepOptions): IJsonStep;
+ // (undocumented)
+ onTestRunFinished(): void;
+}
+
+// @public (undocumented)
+enum KeywordType {
+ // (undocumented)
+ Event = "event",
+ // (undocumented)
+ Outcome = "outcome",
+ // (undocumented)
+ Precondition = "precondition"
+}
+
+declare namespace parallelCanAssignHelpers {
+ export {
+ atMostOnePicklePerTag
+ }
+}
+export { parallelCanAssignHelpers }
+
+// @public @deprecated (undocumented)
+export const parseGherkinMessageStream: typeof cliHelpers.parseGherkinMessageStream;
+
+// @public (undocumented)
+function parseTestCaseAttempt({ testCaseAttempt, snippetBuilder, supportCodeLibrary, }: IParseTestCaseAttemptRequest): IParsedTestCaseAttempt;
+
+// @public @deprecated (undocumented)
+export const PickleFilter: typeof PickleFilter_2;
+
+declare namespace PickleParser {
+ export {
+ getScenarioDescription,
+ getStepKeyword,
+ getPickleStepMap,
+ getPickleLocation,
+ IGetPickleLocationRequest,
+ IGetStepKeywordRequest,
+ IGetScenarioDescriptionRequest
+ }
+}
+
+// @public (undocumented)
+export class ProgressFormatter extends SummaryFormatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ logProgress({ testStepResult: { status } }: TestStepFinished): void;
+}
+
+// @public (undocumented)
+export class RerunFormatter extends Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ formatFailedTestCases(): string;
+ // (undocumented)
+ getFailureMap(): UriToLinesMap;
+ // (undocumented)
+ logFailedTestCases(): void;
+ // (undocumented)
+ protected readonly separator: string;
+}
+
+// @public @deprecated (undocumented)
+export const Runtime: typeof Runtime_2;
+
+// @public (undocumented)
+export const setDefaultTimeout: (milliseconds: number) => void;
+
+// @public (undocumented)
+export const setDefinitionFunctionWrapper: (fn: Function) => void;
+
+// @public (undocumented)
+export const setParallelCanAssign: (fn: ParallelAssignmentValidator_2) => void;
+
+// @public (undocumented)
+export const setWorldConstructor: (fn: any) => void;
+
+// @public (undocumented)
+export class SnippetsFormatter extends Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ logSnippets(): void;
+}
+
+// @public (undocumented)
+export const Status: typeof messages.TestStepResultStatus;
+
+// @public (undocumented)
+export class SummaryFormatter extends Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ logIssues({ issues, title }: ILogIssuesRequest): void;
+ // (undocumented)
+ logSummary(testRunDuration: messages.Duration): void;
+}
+
+// @public (undocumented)
+export const supportCodeLibraryBuilder: SupportCodeLibraryBuilder;
+
+// @public (undocumented)
+export class TestCaseHookDefinition extends Definition implements IDefinition {
+ constructor(data: IDefinitionParameters);
+ // (undocumented)
+ appliesToTestCase(pickle: messages.Pickle): boolean;
+ // (undocumented)
+ getInvocationParameters({ hookParameter, }: IGetInvocationDataRequest): Promise;
+ // (undocumented)
+ readonly name: string;
+ // (undocumented)
+ readonly tagExpression: string;
+}
+
+// @public (undocumented)
+export const Then: IDefineStep_2;
+
+// @public (undocumented)
+export class UsageFormatter extends Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ logUsage(): void;
+}
+
+// @public (undocumented)
+export class UsageJsonFormatter extends Formatter {
+ constructor(options: IFormatterOptions);
+ // (undocumented)
+ static readonly documentation: string;
+ // (undocumented)
+ logUsage(): void;
+ // (undocumented)
+ replacer(key: string, value: any): any;
+}
+
+// @public (undocumented)
+export const version = "10.1.0";
+
+// @public (undocumented)
+export const When: IDefineStep_2;
+
+// @public (undocumented)
+export class World implements IWorld {
+ constructor({ attach, log, parameters }: IWorldOptions);
+ // (undocumented)
+ readonly attach: ICreateAttachment;
+ // (undocumented)
+ readonly log: ICreateLog;
+ // (undocumented)
+ readonly parameters: ParametersType;
+}
+
+// @public (undocumented)
+export function wrapPromiseWithTimeout(promise: Promise, timeoutInMilliseconds: number, timeoutMessage?: string): Promise;
+
+```
diff --git a/package-lock.json b/package-lock.json
index 7b8506460..d7c41dd8a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -57,8 +57,7 @@
"devDependencies": {
"@cucumber/compatibility-kit": "14.1.0",
"@cucumber/query": "12.0.1",
- "@microsoft/api-documenter": "7.19.27",
- "@microsoft/api-extractor": "7.33.7",
+ "@microsoft/api-extractor": "7.39.0",
"@sinonjs/fake-timers": "10.0.2",
"@types/chai": "4.3.4",
"@types/chai-xml": "^0.3.2",
@@ -109,6 +108,8 @@
"stream-to-string": "1.2.0",
"ts-node": "10.9.1",
"tsd": "0.25.0",
+ "typedoc": "^0.25.4",
+ "typedoc-plugin-extras": "^3.0.0",
"typescript": "4.9.4"
},
"engines": {
@@ -1127,56 +1128,38 @@
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
"dev": true
},
- "node_modules/@microsoft/api-documenter": {
- "version": "7.19.27",
- "resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.19.27.tgz",
- "integrity": "sha512-KKNUnDlhRx+tYZsDt3Bn8OqdpCS8V9pce+ZvCjkL+nGHN4G2w1lqAtm82VdzGYgG8HgrwqZ72/Z2bsxKvPho7g==",
- "dev": true,
- "dependencies": {
- "@microsoft/api-extractor-model": "7.25.3",
- "@microsoft/tsdoc": "0.14.2",
- "@rushstack/node-core-library": "3.53.3",
- "@rushstack/ts-command-line": "4.13.1",
- "colors": "~1.2.1",
- "js-yaml": "~3.13.1",
- "resolve": "~1.22.1"
- },
- "bin": {
- "api-documenter": "bin/api-documenter"
- }
- },
"node_modules/@microsoft/api-extractor": {
- "version": "7.33.7",
- "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.33.7.tgz",
- "integrity": "sha512-fQT2v/j/55DhvMFiopLtth66E7xTFNhnumMKgKY14SaG6qU/V1W0e4nOAgbA+SmLakQjAd1Evu06ofaVaxBPbA==",
+ "version": "7.39.0",
+ "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.39.0.tgz",
+ "integrity": "sha512-PuXxzadgnvp+wdeZFPonssRAj/EW4Gm4s75TXzPk09h3wJ8RS3x7typf95B4vwZRrPTQBGopdUl+/vHvlPdAcg==",
"dev": true,
"dependencies": {
- "@microsoft/api-extractor-model": "7.25.3",
+ "@microsoft/api-extractor-model": "7.28.3",
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "~0.16.1",
- "@rushstack/node-core-library": "3.53.3",
- "@rushstack/rig-package": "0.3.17",
- "@rushstack/ts-command-line": "4.13.1",
+ "@rushstack/node-core-library": "3.62.0",
+ "@rushstack/rig-package": "0.5.1",
+ "@rushstack/ts-command-line": "4.17.1",
"colors": "~1.2.1",
"lodash": "~4.17.15",
- "resolve": "~1.17.0",
- "semver": "~7.3.0",
+ "resolve": "~1.22.1",
+ "semver": "~7.5.4",
"source-map": "~0.6.1",
- "typescript": "~4.8.4"
+ "typescript": "5.3.3"
},
"bin": {
"api-extractor": "bin/api-extractor"
}
},
"node_modules/@microsoft/api-extractor-model": {
- "version": "7.25.3",
- "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.25.3.tgz",
- "integrity": "sha512-WWxBUq77p2iZ+5VF7Nmrm3y/UtqCh5bYV8ii3khwq3w99+fXWpvfsAhgSLsC7k8XDQc6De4ssMxH6He/qe1pzg==",
+ "version": "7.28.3",
+ "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.3.tgz",
+ "integrity": "sha512-wT/kB2oDbdZXITyDh2SQLzaWwTOFbV326fP0pUwNW00WeliARs0qjmXBWmGWardEzp2U3/axkO3Lboqun6vrig==",
"dev": true,
"dependencies": {
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "~0.16.1",
- "@rushstack/node-core-library": "3.53.3"
+ "@rushstack/node-core-library": "3.62.0"
}
},
"node_modules/@microsoft/api-extractor/node_modules/lru-cache": {
@@ -1191,22 +1174,10 @@
"node": ">=10"
}
},
- "node_modules/@microsoft/api-extractor/node_modules/resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
- "dev": true,
- "dependencies": {
- "path-parse": "^1.0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/@microsoft/api-extractor/node_modules/semver": {
- "version": "7.3.8",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
- "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@@ -1219,16 +1190,16 @@
}
},
"node_modules/@microsoft/api-extractor/node_modules/typescript": {
- "version": "4.8.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
- "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
+ "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
- "node": ">=4.2.0"
+ "node": ">=14.17"
}
},
"node_modules/@microsoft/api-extractor/node_modules/yallist": {
@@ -1313,27 +1284,28 @@
}
},
"node_modules/@rushstack/node-core-library": {
- "version": "3.53.3",
- "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.53.3.tgz",
- "integrity": "sha512-H0+T5koi5MFhJUd5ND3dI3bwLhvlABetARl78L3lWftJVQEPyzcgTStvTTRiIM5mCltyTM8VYm6BuCtNUuxD0Q==",
+ "version": "3.62.0",
+ "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.62.0.tgz",
+ "integrity": "sha512-88aJn2h8UpSvdwuDXBv1/v1heM6GnBf3RjEy6ZPP7UnzHNCqOHA2Ut+ScYUbXcqIdfew9JlTAe3g+cnX9xQ/Aw==",
"dev": true,
"dependencies": {
- "@types/node": "12.20.24",
"colors": "~1.2.1",
"fs-extra": "~7.0.1",
"import-lazy": "~4.0.0",
"jju": "~1.4.0",
- "resolve": "~1.17.0",
- "semver": "~7.3.0",
+ "resolve": "~1.22.1",
+ "semver": "~7.5.4",
"z-schema": "~5.0.2"
+ },
+ "peerDependencies": {
+ "@types/node": "*"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
}
},
- "node_modules/@rushstack/node-core-library/node_modules/@types/node": {
- "version": "12.20.24",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz",
- "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==",
- "dev": true
- },
"node_modules/@rushstack/node-core-library/node_modules/fs-extra": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
@@ -1369,22 +1341,10 @@
"node": ">=10"
}
},
- "node_modules/@rushstack/node-core-library/node_modules/resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
- "dev": true,
- "dependencies": {
- "path-parse": "^1.0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/@rushstack/node-core-library/node_modules/semver": {
- "version": "7.3.8",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
- "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@@ -1412,31 +1372,19 @@
"dev": true
},
"node_modules/@rushstack/rig-package": {
- "version": "0.3.17",
- "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.3.17.tgz",
- "integrity": "sha512-nxvAGeIMnHl1LlZSQmacgcRV4y1EYtgcDIrw6KkeVjudOMonlxO482PhDj3LVZEp6L7emSf6YSO2s5JkHlwfZA==",
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.1.tgz",
+ "integrity": "sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==",
"dev": true,
"dependencies": {
- "resolve": "~1.17.0",
+ "resolve": "~1.22.1",
"strip-json-comments": "~3.1.1"
}
},
- "node_modules/@rushstack/rig-package/node_modules/resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
- "dev": true,
- "dependencies": {
- "path-parse": "^1.0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/@rushstack/ts-command-line": {
- "version": "4.13.1",
- "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.13.1.tgz",
- "integrity": "sha512-UTQMRyy/jH1IS2U+6pyzyn9xQ2iMcoUKkTcZUzOP/aaMiKlWLwCTDiBVwhw/M1crDx6apF9CwyjuWO9r1SBdJQ==",
+ "version": "4.17.1",
+ "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.17.1.tgz",
+ "integrity": "sha512-2jweO1O57BYP5qdBGl6apJLB+aRIn5ccIRTPDyULh0KMwVzFqWtw6IZWt1qtUoZD/pD2RNkIOosH6Cq45rIYeg==",
"dev": true,
"dependencies": {
"@types/argparse": "1.0.38",
@@ -2247,6 +2195,12 @@
"node": ">=8"
}
},
+ "node_modules/ansi-sequence-parser": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
+ "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
+ "dev": true
+ },
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
@@ -5586,6 +5540,12 @@
"node": ">=6"
}
},
+ "node_modules/jsonc-parser": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
+ "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
+ "dev": true
+ },
"node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
@@ -5730,6 +5690,12 @@
"yallist": "^3.0.2"
}
},
+ "node_modules/lunr": {
+ "version": "2.3.9",
+ "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
+ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
+ "dev": true
+ },
"node_modules/luxon": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz",
@@ -5780,6 +5746,18 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/marked": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
+ "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
+ "dev": true,
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 12"
+ }
+ },
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -7640,6 +7618,18 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/shiki": {
+ "version": "0.14.7",
+ "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz",
+ "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==",
+ "dev": true,
+ "dependencies": {
+ "ansi-sequence-parser": "^1.1.0",
+ "jsonc-parser": "^3.2.0",
+ "vscode-oniguruma": "^1.7.0",
+ "vscode-textmate": "^8.0.0"
+ }
+ },
"node_modules/shx": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz",
@@ -8389,6 +8379,60 @@
"is-typedarray": "^1.0.0"
}
},
+ "node_modules/typedoc": {
+ "version": "0.25.4",
+ "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz",
+ "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==",
+ "dev": true,
+ "dependencies": {
+ "lunr": "^2.3.9",
+ "marked": "^4.3.0",
+ "minimatch": "^9.0.3",
+ "shiki": "^0.14.1"
+ },
+ "bin": {
+ "typedoc": "bin/typedoc"
+ },
+ "engines": {
+ "node": ">= 16"
+ },
+ "peerDependencies": {
+ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x"
+ }
+ },
+ "node_modules/typedoc-plugin-extras": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/typedoc-plugin-extras/-/typedoc-plugin-extras-3.0.0.tgz",
+ "integrity": "sha512-eiAe3qtm2WbV5owdncpt0zHZPqsNZH2mzNGILPd4zqrvEZie3Et9es4cpGZ+8lHO/SI0pVKwsAj7IuMxPNOdYg==",
+ "dev": true,
+ "peerDependencies": {
+ "typedoc": "0.25.x"
+ }
+ },
+ "node_modules/typedoc/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/typedoc/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/typescript": {
"version": "4.9.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz",
@@ -8526,9 +8570,9 @@
}
},
"node_modules/validator": {
- "version": "13.9.0",
- "resolved": "https://registry.npmjs.org/validator/-/validator-13.9.0.tgz",
- "integrity": "sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==",
+ "version": "13.11.0",
+ "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz",
+ "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==",
"dev": true,
"engines": {
"node": ">= 0.10"
@@ -8543,6 +8587,18 @@
"node": ">= 0.8"
}
},
+ "node_modules/vscode-oniguruma": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz",
+ "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==",
+ "dev": true
+ },
+ "node_modules/vscode-textmate": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz",
+ "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==",
+ "dev": true
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/package.json b/package.json
index 6ffe560f5..93a094d18 100644
--- a/package.json
+++ b/package.json
@@ -253,8 +253,7 @@
"devDependencies": {
"@cucumber/compatibility-kit": "14.1.0",
"@cucumber/query": "12.0.1",
- "@microsoft/api-documenter": "7.19.27",
- "@microsoft/api-extractor": "7.33.7",
+ "@microsoft/api-extractor": "7.39.0",
"@sinonjs/fake-timers": "10.0.2",
"@types/chai": "4.3.4",
"@types/chai-xml": "^0.3.2",
@@ -305,6 +304,8 @@
"stream-to-string": "1.2.0",
"ts-node": "10.9.1",
"tsd": "0.25.0",
+ "typedoc": "^0.25.4",
+ "typedoc-plugin-extras": "^3.0.0",
"typescript": "4.9.4"
},
"overrides": {
@@ -313,8 +314,9 @@
"scripts": {
"build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/wrapper.mjs lib/ && shx cp src/api/wrapper.mjs lib/api/",
"cck-test": "mocha 'compatibility/**/*_spec.ts'",
- "docs:ci": "api-extractor run --verbose",
- "docs:local": "api-extractor run --verbose --local && api-documenter markdown --input-folder ./tmp/api-extractor --output-folder ./docs/api",
+ "exports-generate-docs": "typedoc",
+ "exports-test": "api-extractor run --config exports/api/api-extractor.json --verbose && api-extractor run --config exports/root/api-extractor.json --verbose",
+ "exports-update": "api-extractor run --config exports/api/api-extractor.json --verbose --local && api-extractor run --config exports/root/api-extractor.json --verbose --local",
"feature-test": "node bin/cucumber.js",
"lint-code-autofix": "eslint --fix \"{compatibility,example,features,scripts,src,test}/**/*.ts\"",
"lint-code": "eslint \"{compatibility,example,features,scripts,src,test}/**/*.ts\"",
@@ -322,6 +324,9 @@
"lint-format-autofix": "prettier --write .",
"lint-format": "prettier --check .",
"lint": "npm run lint-code && npm run lint-format && npm run lint-dependencies",
+ "preexports-generate-docs": "npm run build-local",
+ "preexports-test": "npm run build-local",
+ "preexports-update": "npm run build-local",
"prelint-autofix": "npm run build-local",
"prelint-code": "npm run build-local",
"precck-test": "npm run build-local",
@@ -330,7 +335,7 @@
"pretest-coverage": "npm run build-local",
"pretypes-test": "npm run build-local",
"test-coverage": "nyc --silent mocha 'src/**/*_spec.ts' 'compatibility/**/*_spec.ts' && nyc --silent --no-clean node bin/cucumber.js --tags \"not @source-mapping\" && nyc report --reporter=lcov",
- "test": "npm run lint && npm run types-test && npm run unit-test && npm run cck-test && npm run feature-test",
+ "test": "npm run lint && npm run exports-test && npm run types-test && npm run unit-test && npm run cck-test && npm run feature-test",
"types-test": "tsd",
"unit-test": "mocha 'src/**/*_spec.ts'",
"update-dependencies": "npx npm-check-updates --upgrade"
diff --git a/reports/.gitkeep b/reports/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/api/convert_configuration.ts b/src/api/convert_configuration.ts
index ebd3988da..9ecf4ef79 100644
--- a/src/api/convert_configuration.ts
+++ b/src/api/convert_configuration.ts
@@ -3,7 +3,7 @@ import {
isTruthyString,
splitFormatDescriptor,
} from '../configuration'
-import { IPublishConfig } from '../formatter'
+import { IPublishConfig } from '../publish'
import { ILogger } from '../logger'
import { IRunConfiguration } from './types'
diff --git a/src/api/environment.ts b/src/api/environment.ts
index 5d88bf4e4..ee5d50ec1 100644
--- a/src/api/environment.ts
+++ b/src/api/environment.ts
@@ -1,9 +1,13 @@
+import { ILogger } from '../logger'
import { IRunEnvironment } from './types'
+import { ConsoleLogger } from './console_logger'
+
+type EnvironmentWithLogger = Required & { logger: ILogger }
export function mergeEnvironment(
provided: IRunEnvironment
-): Required {
- return Object.assign(
+): EnvironmentWithLogger {
+ const fullEnvironment = Object.assign(
{},
{
cwd: process.cwd(),
@@ -14,4 +18,8 @@ export function mergeEnvironment(
},
provided
)
+ return {
+ ...fullEnvironment,
+ logger: new ConsoleLogger(fullEnvironment.stderr, fullEnvironment.debug),
+ }
}
diff --git a/src/api/formatters.ts b/src/api/formatters.ts
index e4ea6adf8..432a6f700 100644
--- a/src/api/formatters.ts
+++ b/src/api/formatters.ts
@@ -6,7 +6,7 @@ import fs from 'mz/fs'
import { mkdirp } from 'mkdirp'
import Formatter, { IFormatterStream } from '../formatter'
import { EventDataCollector } from '../formatter/helpers'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import FormatterBuilder from '../formatter/builder'
import { ILogger } from '../logger'
import { IRunOptionsFormats } from './types'
@@ -31,7 +31,7 @@ export async function initializeFormatters({
eventBroadcaster: EventEmitter
eventDataCollector: EventDataCollector
configuration: IRunOptionsFormats
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}): Promise<() => Promise> {
async function initializeFormatter(
stream: IFormatterStream,
diff --git a/src/api/index.ts b/src/api/index.ts
index e0097383c..6572c8b97 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -1,11 +1,15 @@
/**
- * Cucumber for JavaScript
+ * JavaScript API for running and extending Cucumber
*
- * @remarks These docs cover the API used for running Cucumber programmatically. The entry point is `@cucumber/cucumber/api`.
* @packageDocumentation
+ * @module api
+ * @remarks
+ * These docs cover the API used for running Cucumber programmatically. The entry point is `@cucumber/cucumber/api`.
*/
export { IConfiguration } from '../configuration'
+export { IPickleOrder } from '../filter'
+export { IPublishConfig } from '../publish'
export * from './load_configuration'
export * from './load_sources'
export * from './load_support'
diff --git a/src/api/load_configuration.ts b/src/api/load_configuration.ts
index 8a0df59be..f5677916a 100644
--- a/src/api/load_configuration.ts
+++ b/src/api/load_configuration.ts
@@ -5,7 +5,6 @@ import {
mergeConfigurations,
} from '../configuration'
import { validateConfiguration } from '../configuration/validate_configuration'
-import { ILogger } from '../logger'
import { convertConfiguration } from './convert_configuration'
import { mergeEnvironment } from './environment'
import {
@@ -13,24 +12,24 @@ import {
IResolvedConfiguration,
ILoadConfigurationOptions,
} from './types'
-import { ConsoleLogger } from './console_logger'
/**
- * Load user-authored configuration to be used in a test run.
+ * Load user-authored configuration to be used in a test run
*
* @public
- * @param options - Coordinates required to find configuration.
- * @param environment - Project environment.
+ * @param options - Coordinates required to find configuration
+ * @param environment - Project environment
*/
export async function loadConfiguration(
options: ILoadConfigurationOptions = {},
environment: IRunEnvironment = {}
): Promise {
- const { cwd, stderr, env, debug } = mergeEnvironment(environment)
- const logger: ILogger = new ConsoleLogger(stderr, debug)
+ const { cwd, env, logger } = mergeEnvironment(environment)
const configFile = options.file ?? locateFile(cwd)
if (configFile) {
logger.debug(`Configuration will be loaded from "${configFile}"`)
+ } else if (configFile === false) {
+ logger.debug('Skipping configuration file resolution')
} else {
logger.debug('No configuration file found')
}
diff --git a/src/api/load_configuration_spec.ts b/src/api/load_configuration_spec.ts
new file mode 100644
index 000000000..a5df16bd9
--- /dev/null
+++ b/src/api/load_configuration_spec.ts
@@ -0,0 +1,26 @@
+import { expect } from 'chai'
+import { IRunEnvironment } from './types'
+import { setupEnvironment, teardownEnvironment } from './test_helpers'
+import { loadConfiguration } from './load_configuration'
+
+describe('loadConfiguration', function () {
+ this.timeout(10_000)
+
+ let environment: IRunEnvironment
+ beforeEach(async () => {
+ environment = await setupEnvironment()
+ })
+ afterEach(async () => teardownEnvironment(environment))
+
+ it('should skip trying to resolve from a file if `file=false`', async () => {
+ const { useConfiguration } = await loadConfiguration(
+ { file: false },
+ environment
+ )
+
+ // values from configuration file are not present
+ expect(useConfiguration.paths).to.deep.eq([])
+ expect(useConfiguration.requireModule).to.deep.eq([])
+ expect(useConfiguration.require).to.deep.eq([])
+ })
+})
diff --git a/src/api/load_sources.ts b/src/api/load_sources.ts
index 9725b1df3..fd4602af2 100644
--- a/src/api/load_sources.ts
+++ b/src/api/load_sources.ts
@@ -1,5 +1,4 @@
import { IdGenerator } from '@cucumber/messages'
-import { ILogger } from '../logger'
import { resolvePaths } from '../paths'
import {
ILoadSourcesResult,
@@ -10,23 +9,22 @@ import {
} from './types'
import { mergeEnvironment } from './environment'
import { getPicklesAndErrors } from './gherkin'
-import { ConsoleLogger } from './console_logger'
import { initializeForLoadSources } from './plugins'
/**
- * Load and parse features, produce a filtered and ordered test plan and/or parse errors.
+ * Load and parse features, produce a filtered and ordered test plan and/or
+ * parse errors
*
* @public
- * @param coordinates - Coordinates required to find features
- * @param environment - Project environment.
+ * @param coordinates - Coordinates required to find and process features
+ * @param environment - Project environment
*/
export async function loadSources(
coordinates: ISourcesCoordinates,
environment: IRunEnvironment = {}
): Promise {
const mergedEnvironment = mergeEnvironment(environment)
- const { cwd, stderr, debug } = mergedEnvironment
- const logger: ILogger = new ConsoleLogger(stderr, debug)
+ const { cwd, logger } = mergedEnvironment
const newId = IdGenerator.uuid()
const pluginManager = await initializeForLoadSources(
logger,
diff --git a/src/api/load_support.ts b/src/api/load_support.ts
index bf25c37e5..0fec368ec 100644
--- a/src/api/load_support.ts
+++ b/src/api/load_support.ts
@@ -1,27 +1,27 @@
import { IdGenerator } from '@cucumber/messages'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
-import { ILogger } from '../logger'
import { resolvePaths } from '../paths'
-import { ILoadSupportOptions, IRunEnvironment } from './types'
+import {
+ ILoadSupportOptions,
+ IRunEnvironment,
+ ISupportCodeLibrary,
+} from './types'
import { getSupportCodeLibrary } from './support'
import { mergeEnvironment } from './environment'
-import { ConsoleLogger } from './console_logger'
import { initializeForLoadSupport } from './plugins'
/**
- * Load support code for use in test runs.
+ * Load support code for use in test runs
*
* @public
- * @param options - Subset of `IRunnableConfiguration` required to find the support code.
- * @param environment - Project environment.
+ * @param options - Options required to find the support code
+ * @param environment - Project environment
*/
export async function loadSupport(
options: ILoadSupportOptions,
environment: IRunEnvironment = {}
): Promise {
const mergedEnvironment = mergeEnvironment(environment)
- const { cwd, stderr, debug } = mergedEnvironment
- const logger: ILogger = new ConsoleLogger(stderr, debug)
+ const { cwd, logger } = mergedEnvironment
const newId = IdGenerator.uuid()
const pluginManager = await initializeForLoadSupport()
const resolvedPaths = await resolvePaths(
diff --git a/src/api/run_cucumber.ts b/src/api/run_cucumber.ts
index 91b760552..ce141173a 100644
--- a/src/api/run_cucumber.ts
+++ b/src/api/run_cucumber.ts
@@ -2,8 +2,8 @@ import { EventEmitter } from 'node:events'
import { Envelope, IdGenerator, ParseError } from '@cucumber/messages'
import { EventDataCollector } from '../formatter/helpers'
import { emitMetaMessage, emitSupportCodeMessages } from '../cli/helpers'
-import { ILogger } from '../logger'
import { resolvePaths } from '../paths'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { IRunOptions, IRunEnvironment, IRunResult } from './types'
import { makeRuntime } from './runtime'
import { initializeFormatters } from './formatters'
@@ -11,36 +11,34 @@ import { getSupportCodeLibrary } from './support'
import { mergeEnvironment } from './environment'
import { getPicklesAndErrors } from './gherkin'
import { initializeForRunCucumber } from './plugins'
-import { ConsoleLogger } from './console_logger'
/**
- * Execute a Cucumber test run.
+ * Execute a Cucumber test run and return the overall result
*
* @public
- * @param configuration - Configuration loaded from `loadConfiguration`.
- * @param environment - Project environment.
- * @param onMessage - Callback fired each time Cucumber emits a message.
+ * @param options - Options for the run, obtainable via {@link loadConfiguration}
+ * @param environment - Project environment
+ * @param onMessage - Callback fired each time Cucumber emits a message
*/
export async function runCucumber(
- configuration: IRunOptions,
+ options: IRunOptions,
environment: IRunEnvironment = {},
onMessage?: (message: Envelope) => void
): Promise {
const mergedEnvironment = mergeEnvironment(environment)
- const { cwd, stdout, stderr, env, debug } = mergedEnvironment
- const logger: ILogger = new ConsoleLogger(stderr, debug)
+ const { cwd, stdout, stderr, env, logger } = mergedEnvironment
const newId = IdGenerator.uuid()
const supportCoordinates =
- 'World' in configuration.support
- ? configuration.support.originalCoordinates
- : configuration.support
+ 'originalCoordinates' in options.support
+ ? options.support.originalCoordinates
+ : options.support
const pluginManager = await initializeForRunCucumber(
logger,
{
- ...configuration,
+ ...options,
support: supportCoordinates,
},
mergedEnvironment
@@ -49,15 +47,15 @@ export async function runCucumber(
const resolvedPaths = await resolvePaths(
logger,
cwd,
- configuration.sources,
+ options.sources,
supportCoordinates
)
pluginManager.emit('paths:resolve', resolvedPaths)
const { sourcePaths, requirePaths, importPaths } = resolvedPaths
const supportCodeLibrary =
- 'World' in configuration.support
- ? configuration.support
+ 'originalCoordinates' in options.support
+ ? (options.support as SupportCodeLibrary)
: await getSupportCodeLibrary({
cwd,
newId,
@@ -85,7 +83,7 @@ export async function runCucumber(
onStreamError: () => (formatterStreamError = true),
eventBroadcaster,
eventDataCollector,
- configuration: configuration.formats,
+ configuration: options.formats,
supportCodeLibrary,
})
await emitMetaMessage(eventBroadcaster, env)
@@ -97,7 +95,7 @@ export async function runCucumber(
newId,
cwd,
sourcePaths,
- coordinates: configuration.sources,
+ coordinates: options.sources,
onEnvelope: (envelope) => eventBroadcaster.emit('envelope', envelope),
})
const filteredPickles = await pluginManager.transform(
@@ -142,7 +140,7 @@ export async function runCucumber(
requireModules: supportCoordinates.requireModules,
requirePaths,
importPaths,
- options: configuration.runtime,
+ options: options.runtime,
})
const success = await runtime.start()
await cleanupFormatters()
diff --git a/src/api/runtime.ts b/src/api/runtime.ts
index db5e364d0..f228df577 100644
--- a/src/api/runtime.ts
+++ b/src/api/runtime.ts
@@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events'
import { IdGenerator } from '@cucumber/messages'
import Runtime, { IRuntime } from '../runtime'
import { EventDataCollector } from '../formatter/helpers'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import Coordinator from '../runtime/parallel/coordinator'
import { ILogger } from '../logger'
import { IRunOptionsRuntime } from './types'
@@ -26,7 +26,7 @@ export function makeRuntime({
eventDataCollector: EventDataCollector
newId: IdGenerator.NewId
pickleIds: string[]
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
requireModules: string[]
requirePaths: string[]
importPaths: string[]
diff --git a/src/api/support.ts b/src/api/support.ts
index 958b17091..cf84b44d7 100644
--- a/src/api/support.ts
+++ b/src/api/support.ts
@@ -1,6 +1,6 @@
import { pathToFileURL } from 'node:url'
import { IdGenerator } from '@cucumber/messages'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import supportCodeLibraryBuilder from '../support_code_library_builder'
import tryRequire from '../try_require'
@@ -16,7 +16,7 @@ export async function getSupportCodeLibrary({
requireModules: string[]
requirePaths: string[]
importPaths: string[]
-}): Promise {
+}): Promise {
supportCodeLibraryBuilder.reset(cwd, newId, {
requireModules,
requirePaths,
diff --git a/src/api/types.ts b/src/api/types.ts
index 0cb016f4b..69aea7ba4 100644
--- a/src/api/types.ts
+++ b/src/api/types.ts
@@ -1,57 +1,86 @@
import { Writable } from 'node:stream'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
-import { FormatOptions, IPublishConfig } from '../formatter'
-import { PickleOrder } from '../models/pickle_order'
-import { IRuntimeOptions } from '../runtime'
+import { JsonObject } from 'type-fest'
+import { IPublishConfig } from '../publish'
import { IConfiguration } from '../configuration'
+import { IPickleOrder } from '../filter'
/**
+ * Options for {@link loadConfiguration}
* @public
*/
export interface ILoadConfigurationOptions {
/**
- * Path to load configuration file from (defaults to `cucumber.(js|cjs|mjs|json)` if omitted).
+ * Path to load configuration file from, or `false` to skip
+ * @default `cucumber.(json|yaml|yml|js|cjs|mjs)`
*/
- file?: string
+ file?: string | false
/**
- * Zero or more profile names from which to source configuration (if omitted or empty, the `default` profile will be used).
+ * Zero or more profile names from which to source configuration in the file
+ * @remarks
+ * If omitted or empty, the `default` profile will be used.
*/
profiles?: string[]
/**
- * Ad-hoc configuration options to be applied over the top of whatever is loaded from the configuration file/profiles.
+ * Ad-hoc configuration options to be merged over the top of whatever is
+ * loaded from the configuration file/profiles
*/
provided?: Partial
}
/**
+ * Response from {@link loadConfiguration}
* @public
*/
export interface IResolvedConfiguration {
/**
- * The final flat configuration object resolved from the configuration file/profiles plus any extra provided.
+ * The final flat configuration object resolved from the configuration
+ * file/profiles plus any extra provided
*/
useConfiguration: IConfiguration
/**
- * The format that can be passed into `runCucumber`.
+ * The format that can be passed into {@link runCucumber}
*/
runConfiguration: IRunConfiguration
}
/**
+ * Options relating to sources (i.e. feature files) - where to load them from,
+ * how to interpret, filter and order them
* @public
*/
export interface ISourcesCoordinates {
+ /**
+ * Default Gherkin dialect
+ * @remarks
+ * Used if no dialect is specified in the feature file itself.
+ */
defaultDialect: string
+ /**
+ * Paths and/or glob expressions to feature files
+ */
paths: string[]
+ /**
+ * Regular expressions of which scenario names should match one of to be run
+ */
names: string[]
+ /**
+ * Tag expression to filter which scenarios should be run
+ */
tagExpression: string
- order: PickleOrder
+ /**
+ * Run in the order defined, or in a random order
+ */
+ order: IPickleOrder
}
/**
+ * A pickle that has been successfully compiled from a source
* @public
*/
export interface IPlannedPickle {
+ /**
+ * Name of the pickle (after parameter resolution)
+ */
name: string
uri: string
location: {
@@ -61,6 +90,7 @@ export interface IPlannedPickle {
}
/**
+ * An error encountered when parsing a source
* @public
*/
export interface ISourcesError {
@@ -69,52 +99,139 @@ export interface ISourcesError {
line: number
column?: number
}
+ /**
+ * Error message explaining what went wrong with the parse
+ */
message: string
}
/**
+ * Response from {@link loadSources}
* @public
*/
export interface ILoadSourcesResult {
+ /**
+ * Pickles that have been successfully compiled, in the order they would be
+ * run in
+ */
plan: IPlannedPickle[]
+ /**
+ * Any errors encountered when parsing sources
+ */
errors: ISourcesError[]
}
/**
+ * Options relating to user code (aka support code) - where to load it from and
+ * how to preprocess it
* @public
*/
export interface ISupportCodeCoordinates {
+ /**
+ * Names of transpilation modules to load, via `require()`
+ */
requireModules: string[]
+ /**
+ * Paths and/or glob expressions of user code to load, via `require()`
+ */
requirePaths: string[]
+ /**
+ * Paths and/or glob expressions of user code to load, via `import()`
+ */
importPaths: string[]
}
/**
+ * Options for {@link loadSupport}
* @public
+ * @remarks
+ * A subset of {@link IRunConfiguration}
*/
export interface ILoadSupportOptions {
+ /**
+ * @remarks
+ * This is needed because the default support path locations are derived from
+ * feature file locations.
+ */
sources: ISourcesCoordinates
support: ISupportCodeCoordinates
}
/**
+ * Options relating to behaviour when actually running tests
* @public
*/
-export interface IRunOptionsRuntime extends IRuntimeOptions {
+export interface IRunOptionsRuntime {
+ /**
+ * Perform a dry run, where a test run is prepared but nothing is executed
+ */
+ dryRun: boolean
+ /**
+ * Stop running tests when a test fails
+ */
+ failFast: boolean
+ /**
+ * Filter out stack frames from Cucumber's code when formatting stack traces
+ */
+ filterStacktraces: boolean
+ /**
+ * Run tests in parallel with the given number of worker processes
+ */
parallel: number
+ /**
+ * Retry failing tests up to the given number of times
+ */
+ retry: number
+ /**
+ * Tag expression to filter which scenarios can be retried
+ */
+ retryTagFilter: string
+ /**
+ * Fail the test run if there are pending steps
+ */
+ strict: boolean
+ /**
+ * Parameters to be passed to the World
+ * @remarks
+ * The value must be a JSON-serializable object.
+ */
+ worldParameters: JsonObject
}
/**
+ * Options relating to formatters - which ones to use, where to write their
+ * output, how they should behave
* @public
*/
export interface IRunOptionsFormats {
+ /**
+ * Name/path of the formatter to use for `stdout` output
+ */
stdout: string
+ /**
+ * Zero or more mappings of file output path (key) to name/path of the
+ * formatter to use (value)
+ * @example
+ * \{
+ * "./reports/cucumber.html": "html",
+ * "./reports/custom.txt": "./custom-formatter.js"
+ * \}
+ */
files: Record
+ /**
+ * Options for report publication, or `false` to disable publication
+ */
publish: IPublishConfig | false
- options: FormatOptions
+ /**
+ * Options to be provided to formatters
+ * @remarks
+ * The value must be a JSON-serializable object.
+ */
+ options: JsonObject
}
/**
+ * Structured configuration object suitable for passing to {@link runCucumber}
* @public
*/
export interface IRunConfiguration {
@@ -125,18 +242,36 @@ export interface IRunConfiguration {
}
/**
+ * A collection of user-defined code and setup ("support code") that can be
+ * used for a test run
* @public
+ * @remarks
+ * This is mostly a marker interface. The actual instance is a complex object
+ * that you shouldn't interact with directly, but some functions return and/or
+ * accept it as a means of optimising a test workflow.
*/
-export type ISupportCodeCoordinatesOrLibrary =
- | ISupportCodeCoordinates
- | ISupportCodeLibrary
+export interface ISupportCodeLibrary {
+ readonly originalCoordinates: ISupportCodeCoordinates
+}
/**
+ * Either an actual {@link ISupportCodeLibrary | support code library}, or the
+ * {@link ISupportCodeCoordinates | coordinates} required to create and
+ * populate one
* @public
+ * @remarks
+ * This alias exists because {@link runCucumber} will accept an existing
+ * support code library in its options and thus avoid trying to load it again,
+ * improving performance and avoiding cache issues for use cases where multiple
+ * test runs happen within the same process. Note this is only useful in serial
+ * mode, as parallel workers will each load the support code themselves anyway.
*/
-export type { ISupportCodeLibrary }
+export type ISupportCodeCoordinatesOrLibrary =
+ | ISupportCodeCoordinates
+ | ISupportCodeLibrary
/**
+ * Options for {@link runCucumber}
* @public
*/
export interface IRunOptions {
@@ -147,45 +282,54 @@ export interface IRunOptions {
}
/**
- * Contextual data about the project environment.
- *
+ * Contextual data about the project environment
* @public
*/
export interface IRunEnvironment {
/**
- * Working directory for the project (defaults to `process.cwd()` if omitted).
+ * Working directory for the project
+ * @default process.cwd()
*/
cwd?: string
/**
- * Writable stream where the test run's main output is written (defaults to `process.stdout` if omitted).
+ * Writable stream where the test run's main formatter output is written
+ * @default process.stdout
*/
stdout?: Writable
/**
- * Writable stream where the test run's warning/error output is written (defaults to `process.stderr` if omitted).
+ * Writable stream where the test run's warning/error output is written
+ * @default process.stderr
*/
stderr?: Writable
/**
- * Environment variables (defaults to `process.env` if omitted).
+ * Environment variables
+ * @default process.env
*/
env?: NodeJS.ProcessEnv
/**
- * Whether debug logging is enabled.
+ * Whether debug logging should be emitted to {@link IRunEnvironment.stderr}
+ * @default false
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/debugging.md}
*/
debug?: boolean
}
/**
- * Result of a Cucumber test run.
- *
+ * Response from {@link runCucumber}
* @public
*/
export interface IRunResult {
/**
- * Whether the test run was overall successful i.e. no failed scenarios. The exact meaning can vary based on the `strict` configuration option.
+ * Whether the test run was overall successful
+ * @remarks
+ * The exact meaning can vary based on the `strict` configuration option.
*/
success: boolean
/**
- * The support code library that was used in the test run; can be reused in subsequent `runCucumber` calls.
+ * The support code library that was used in the test run
+ * @remarks
+ * This can be reused in subsequent {@link runCucumber} calls,
+ * see {@link ISupportCodeCoordinatesOrLibrary}
*/
support: ISupportCodeLibrary
}
diff --git a/src/cli/helpers.ts b/src/cli/helpers.ts
index 7a091791d..b78f4a91d 100644
--- a/src/cli/helpers.ts
+++ b/src/cli/helpers.ts
@@ -8,13 +8,13 @@ import detectCiEnvironment from '@cucumber/ci-environment'
import { doesHaveValue } from '../value_checker'
import { EventDataCollector } from '../formatter/helpers'
import PickleFilter from '../pickle_filter'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import TestCaseHookDefinition from '../models/test_case_hook_definition'
import TestRunHookDefinition from '../models/test_run_hook_definition'
-import { PickleOrder } from '../models/pickle_order'
import { version } from '../version'
import { ILogger } from '../logger'
import { ILineAndUri } from '../types'
+import { IPickleOrder } from '../filter'
interface IParseGherkinMessageStreamRequest {
cwd?: string
@@ -57,7 +57,7 @@ export async function parseGherkinMessageStream({
}
})
gherkinMessageStream.on('end', () => {
- orderPickles(result, order, console)
+ orderPickles(result, order as IPickleOrder, console)
resolve(result)
})
gherkinMessageStream.on('error', reject)
@@ -67,7 +67,7 @@ export async function parseGherkinMessageStream({
// Orders the pickleIds in place - morphs input
export function orderPickles(
pickleIds: T[],
- order: PickleOrder,
+ order: IPickleOrder,
logger: ILogger
): void {
const [type, seed] = splitOrder(order)
@@ -133,7 +133,7 @@ const makeSourceReference = (source: ILineAndUri) => ({
})
function emitParameterTypes(
- supportCodeLibrary: ISupportCodeLibrary,
+ supportCodeLibrary: SupportCodeLibrary,
eventBroadcaster: EventEmitter,
newId: IdGenerator.NewId
): void {
@@ -159,7 +159,7 @@ function emitParameterTypes(
}
function emitUndefinedParameterTypes(
- supportCodeLibrary: ISupportCodeLibrary,
+ supportCodeLibrary: SupportCodeLibrary,
eventBroadcaster: EventEmitter
): void {
for (const undefinedParameterType of supportCodeLibrary.undefinedParameterTypes) {
@@ -171,7 +171,7 @@ function emitUndefinedParameterTypes(
}
function emitStepDefinitions(
- supportCodeLibrary: ISupportCodeLibrary,
+ supportCodeLibrary: SupportCodeLibrary,
eventBroadcaster: EventEmitter
): void {
supportCodeLibrary.stepDefinitions.forEach((stepDefinition) => {
@@ -193,7 +193,7 @@ function emitStepDefinitions(
}
function emitTestCaseHooks(
- supportCodeLibrary: ISupportCodeLibrary,
+ supportCodeLibrary: SupportCodeLibrary,
eventBroadcaster: EventEmitter
): void {
;[]
@@ -215,7 +215,7 @@ function emitTestCaseHooks(
}
function emitTestRunHooks(
- supportCodeLibrary: ISupportCodeLibrary,
+ supportCodeLibrary: SupportCodeLibrary,
eventBroadcaster: EventEmitter
): void {
;[]
@@ -240,7 +240,7 @@ export function emitSupportCodeMessages({
newId,
}: {
eventBroadcaster: EventEmitter
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
newId: IdGenerator.NewId
}): void {
emitParameterTypes(supportCodeLibrary, eventBroadcaster, newId)
diff --git a/src/cli/helpers_spec.ts b/src/cli/helpers_spec.ts
index 82586969f..3021cde7c 100644
--- a/src/cli/helpers_spec.ts
+++ b/src/cli/helpers_spec.ts
@@ -1,8 +1,8 @@
import { EventEmitter } from 'node:events'
import { Readable } from 'node:stream'
import { GherkinStreams } from '@cucumber/gherkin-streams'
-import { IdGenerator, SourceMediaType } from '@cucumber/messages'
import * as messages from '@cucumber/messages'
+import { IdGenerator, SourceMediaType } from '@cucumber/messages'
import { expect } from 'chai'
import { describe, it } from 'mocha'
import {
@@ -13,11 +13,11 @@ import {
import { EventDataCollector } from '../formatter/helpers'
import PickleFilter from '../pickle_filter'
import StepDefinition from '../models/step_definition'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import TestCaseHookDefinition from '../models/test_case_hook_definition'
import TestRunHookDefinition from '../models/test_run_hook_definition'
-import { PickleOrder } from '../models/pickle_order'
import { SourcedParameterTypeRegistry } from '../support_code_library_builder/sourced_parameter_type_registry'
+import { IPickleOrder } from '../api'
import {
emitMetaMessage,
emitSupportCodeMessages,
@@ -30,7 +30,7 @@ const noopFunction = (): void => {
interface ITestParseGherkinMessageStreamRequest {
gherkinMessageStream: Readable
- order: PickleOrder
+ order: IPickleOrder
pickleFilter: PickleFilter
}
@@ -57,7 +57,7 @@ async function testParseGherkinMessageStream(
}
function testEmitSupportCodeMessages(
- supportCode: Partial
+ supportCode: Partial
): messages.Envelope[] {
const envelopes: messages.Envelope[] = []
const eventBroadcaster = new EventEmitter()
diff --git a/src/configuration/check_schema.ts b/src/configuration/check_schema.ts
index 9538d7b18..f8ffba14c 100644
--- a/src/configuration/check_schema.ts
+++ b/src/configuration/check_schema.ts
@@ -12,7 +12,7 @@ const schema = yup.object().shape({
.of(
yup.lazy((val) =>
Array.isArray(val)
- ? yup.array().of(yup.string()).min(2).max(2)
+ ? yup.array().of(yup.string()).min(1).max(2)
: yup.string()
)
),
@@ -20,7 +20,7 @@ const schema = yup.object().shape({
import: yup.array().of(yup.string()),
language: yup.string().oneOf(Object.keys(dialects)),
name: yup.array().of(yup.string()),
- order: yup.string().oneOf(['defined', 'random']),
+ order: yup.string().matches(/^random:.*|random|defined$/),
paths: yup.array().of(yup.string()),
parallel: yup.number().integer().min(0),
publish: yup.boolean(),
diff --git a/src/configuration/types.ts b/src/configuration/types.ts
index ca1a1edfb..82bce3973 100644
--- a/src/configuration/types.ts
+++ b/src/configuration/types.ts
@@ -1,32 +1,148 @@
import { JsonObject } from 'type-fest'
-import { FormatOptions } from '../formatter'
-import { PickleOrder } from '../models/pickle_order'
-
-type FormatsConfiguration = Array
+import { IPickleOrder } from '../filter'
+/**
+ * User-defined configuration
+ *
+ * @public
+ */
export interface IConfiguration {
+ /**
+ * Paths to where your feature files are
+ * @default []
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-features}
+ */
+ paths: string[]
+ /**
+ * Show the full backtrace for errors
+ * @default false
+ */
backtrace: boolean
+ /**
+ * Perform a dry run, where a test run is prepared but nothing is executed
+ * @default false
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/dry_run.md}
+ */
dryRun: boolean
+ /**
+ * Explicitly call `process.exit()` after the test run
+ * @default false
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#exiting}
+ * @remarks
+ * This option is only used by the CLI.
+ */
forceExit: boolean
+ /**
+ * Stop running tests when a test fails
+ * @default false
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/fail_fast.md}
+ */
failFast: boolean
- format: FormatsConfiguration
- formatOptions: FormatOptions
+ /**
+ * Name/path and (optionally) output file path of each formatter to use
+ *
+ * @example
+ * [
+ * "\@cucumber/pretty-formatter",
+ * ["html", "./reports/cucumber.html"],
+ * ["./custom-formatter.js", "./reports/custom.txt"]
+ * ]
+ * @default []
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md}
+ * @remarks
+ * Each item has one or two values. The first (required) identifies the
+ * formatter to be used. The second (optional) specifies where the output
+ * should be written.
+ */
+ format: Array
+ /**
+ * Options to be provided to formatters
+ * @default \{\}
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md#options}
+ * @remarks
+ * The value must be a JSON-serializable object.
+ */
+ formatOptions: JsonObject
+ /**
+ * Paths to where your support code is
+ * @default []
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code}
+ */
import: string[]
+ /**
+ * Default language for your feature files
+ * @default "en"
+ */
language: string
+ /**
+ * Regular expressions of which scenario names should match one of to be run
+ * @default []
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#names}
+ */
name: string[]
- order: PickleOrder
- paths: string[]
+ /**
+ * Run in the order defined, or in a random order
+ * @default "defined"
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#order}
+ */
+ order: IPickleOrder
+ /**
+ * Run tests in parallel with the given number of worker processes
+ * @default 0
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/parallel.md}
+ */
parallel: number
+ /**
+ * Publish a report of your test run to https://reports.cucumber.io/
+ * @default false
+ */
publish: boolean
/**
- * @deprecated no longer needed; see
+ * @deprecated no longer needed
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md}
*/
publishQuiet: boolean
+ /**
+ * Paths to where your support code is, for CommonJS
+ * @default []
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code}
+ */
require: string[]
+ /**
+ * Names of transpilation modules to load, via `require()`
+ * @default []
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/transpiling.md}
+ */
requireModule: string[]
+ /**
+ * Retry failing tests up to the given number of times
+ * @default 0
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md}
+ */
retry: number
+ /**
+ * Tag expression to filter which scenarios can be retried
+ * @default ""
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md}
+ */
retryTagFilter: string
+ /**
+ * Fail the test run if there are pending steps
+ * @default true
+ */
strict: boolean
+ /**
+ * Tag expression to filter which scenarios should be run
+ * @default ""
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#tags}
+ */
tags: string
+ /**
+ * Parameters to be passed to your World
+ * @default \{\}
+ * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/world.md}
+ * @remarks
+ * The value must be a JSON-serializable object.
+ */
worldParameters: JsonObject
}
diff --git a/src/filter/types.ts b/src/filter/types.ts
index e30628c0e..5818a7de8 100644
--- a/src/filter/types.ts
+++ b/src/filter/types.ts
@@ -1,5 +1,14 @@
import { GherkinDocument, Location, Pickle } from '@cucumber/messages'
+/**
+ * The ordering strategy for pickles
+ * @public
+ * @example "defined"
+ * @example "random"
+ * @example "random:234119"
+ */
+export type IPickleOrder = 'defined' | 'random' | `random:${string}`
+
export interface IFilterablePickle {
pickle: Pickle
gherkinDocument: GherkinDocument
diff --git a/src/formatter/builder.ts b/src/formatter/builder.ts
index 98c54423e..7c7f2f8b0 100644
--- a/src/formatter/builder.ts
+++ b/src/formatter/builder.ts
@@ -3,7 +3,7 @@ import { EventEmitter } from 'node:events'
import { Writable as WritableStream } from 'node:stream'
import { pathToFileURL } from 'node:url'
import { doesHaveValue, doesNotHaveValue } from '../value_checker'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'
import EventDataCollector from './helpers/event_data_collector'
import StepDefinitionSnippetBuilder from './step_definition_snippet_builder'
@@ -20,7 +20,7 @@ interface IGetStepDefinitionSnippetBuilderOptions {
cwd: string
snippetInterface?: SnippetInterface
snippetSyntax?: string
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
export interface IBuildOptions {
@@ -32,7 +32,7 @@ export interface IBuildOptions {
parsedArgvOptions: FormatOptions
stream: WritableStream
cleanup: IFormatterCleanupFn
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
const FormatterBuilder = {
diff --git a/src/formatter/helpers/issue_helpers.ts b/src/formatter/helpers/issue_helpers.ts
index 54cb13a5c..944668d26 100644
--- a/src/formatter/helpers/issue_helpers.ts
+++ b/src/formatter/helpers/issue_helpers.ts
@@ -2,7 +2,7 @@ import indentString from 'indent-string'
import * as messages from '@cucumber/messages'
import { IColorFns } from '../get_color_fns'
import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'
-import { ISupportCodeLibrary } from '../../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../support_code_library_builder/types'
import { formatTestCaseAttempt } from './test_case_attempt_formatter'
import { ITestCaseAttempt } from './event_data_collector'
@@ -35,7 +35,7 @@ export interface IFormatIssueRequest {
number: number
snippetBuilder: StepDefinitionSnippetBuilder
testCaseAttempt: ITestCaseAttempt
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
printAttachments?: boolean
}
diff --git a/src/formatter/helpers/summary_helpers_spec.ts b/src/formatter/helpers/summary_helpers_spec.ts
index 007227a4f..375c31cee 100644
--- a/src/formatter/helpers/summary_helpers_spec.ts
+++ b/src/formatter/helpers/summary_helpers_spec.ts
@@ -9,14 +9,14 @@ import { getBaseSupportCodeLibrary } from '../../../test/fixtures/steps'
import timeMethods, { durationBetweenTimestamps } from '../../time'
import { buildSupportCodeLibrary } from '../../../test/runtime_helpers'
import { IRuntimeOptions } from '../../runtime'
-import { ISupportCodeLibrary } from '../../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../support_code_library_builder/types'
import { doesNotHaveValue } from '../../value_checker'
import { formatSummary } from './summary_helpers'
interface ITestFormatSummaryOptions {
runtimeOptions?: Partial
sourceData: string
- supportCodeLibrary?: ISupportCodeLibrary
+ supportCodeLibrary?: SupportCodeLibrary
testRunStarted?: messages.TestRunStarted
testRunFinished?: messages.TestRunFinished
}
diff --git a/src/formatter/helpers/test_case_attempt_formatter.ts b/src/formatter/helpers/test_case_attempt_formatter.ts
index 9d87d59c1..e3c9543dc 100644
--- a/src/formatter/helpers/test_case_attempt_formatter.ts
+++ b/src/formatter/helpers/test_case_attempt_formatter.ts
@@ -4,7 +4,7 @@ import figures from 'figures'
import { IColorFns } from '../get_color_fns'
import { doesHaveValue, valueOrDefault } from '../../value_checker'
import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'
-import { ISupportCodeLibrary } from '../../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../support_code_library_builder/types'
import { formatLocation } from './location_helpers'
import {
IParsedTestStep,
@@ -90,7 +90,7 @@ export interface IFormatTestCaseAttemptRequest {
colorFns: IColorFns
testCaseAttempt: ITestCaseAttempt
snippetBuilder: StepDefinitionSnippetBuilder
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
printAttachments?: boolean
}
diff --git a/src/formatter/helpers/test_case_attempt_parser.ts b/src/formatter/helpers/test_case_attempt_parser.ts
index aa15c3aac..04d1ce2f5 100644
--- a/src/formatter/helpers/test_case_attempt_parser.ts
+++ b/src/formatter/helpers/test_case_attempt_parser.ts
@@ -1,7 +1,7 @@
import * as messages from '@cucumber/messages'
import { TestStepResult } from '@cucumber/messages'
import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'
-import { ISupportCodeLibrary } from '../../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../support_code_library_builder/types'
import { doesHaveValue, valueOrDefault } from '../../value_checker'
import TestCaseHookDefinition from '../../models/test_case_hook_definition'
import { ILineAndUri } from '../../types'
@@ -45,7 +45,7 @@ interface IParseStepRequest {
pickleStep: messages.PickleStep
pickleUri: string
snippetBuilder: StepDefinitionSnippetBuilder
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
testStep: messages.TestStep
testStepResult: messages.TestStepResult
testStepAttachments: messages.Attachment[]
@@ -121,7 +121,7 @@ function parseStep({
export interface IParseTestCaseAttemptRequest {
testCaseAttempt: ITestCaseAttempt
snippetBuilder: StepDefinitionSnippetBuilder
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
// Converts a testCaseAttempt into a json object with all data needed for
diff --git a/src/formatter/index.ts b/src/formatter/index.ts
index e8d668877..40ae1bd0c 100644
--- a/src/formatter/index.ts
+++ b/src/formatter/index.ts
@@ -1,6 +1,6 @@
import { Writable } from 'node:stream'
import { EventEmitter } from 'node:events'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { valueOrDefault } from '../value_checker'
import { IColorFns } from './get_color_fns'
import { EventDataCollector } from './helpers'
@@ -20,11 +20,6 @@ export interface FormatOptions {
[customKey: string]: any
}
-export interface IPublishConfig {
- url: string
- token: string
-}
-
export type IFormatterStream = Writable
export type IFormatterLogFn = (buffer: string | Uint8Array) => void
export type IFormatterCleanupFn = () => Promise
@@ -39,7 +34,7 @@ export interface IFormatterOptions {
snippetBuilder: StepDefinitionSnippetBuilder
stream: Writable
cleanup: IFormatterCleanupFn
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
export default class Formatter {
@@ -49,7 +44,7 @@ export default class Formatter {
protected log: IFormatterLogFn
protected snippetBuilder: StepDefinitionSnippetBuilder
protected stream: Writable
- protected supportCodeLibrary: ISupportCodeLibrary
+ protected supportCodeLibrary: SupportCodeLibrary
protected printAttachments: boolean
private readonly cleanup: IFormatterCleanupFn
static readonly documentation: string
diff --git a/src/formatter/junit_formatter_spec.ts b/src/formatter/junit_formatter_spec.ts
index d16012074..a0721b3b3 100644
--- a/src/formatter/junit_formatter_spec.ts
+++ b/src/formatter/junit_formatter_spec.ts
@@ -4,14 +4,14 @@ import chaiXml from 'chai-xml'
import FakeTimers, { InstalledClock } from '@sinonjs/fake-timers'
import timeMethods from '../time'
import { testFormatter } from '../../test/formatter_helpers'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { buildSupportCodeLibrary } from '../../test/runtime_helpers'
use(chaiXml)
function getJUnitFormatterSupportCodeLibrary(
clock: InstalledClock
-): ISupportCodeLibrary {
+): SupportCodeLibrary {
return buildSupportCodeLibrary(__dirname, ({ Before, After, Given }) => {
Before(function () {}) // eslint-disable-line @typescript-eslint/no-empty-function
After(function () {}) // eslint-disable-line @typescript-eslint/no-empty-function
diff --git a/src/formatter/progress_bar_formatter_spec.ts b/src/formatter/progress_bar_formatter_spec.ts
index 3f41c39f7..aac4f8beb 100644
--- a/src/formatter/progress_bar_formatter_spec.ts
+++ b/src/formatter/progress_bar_formatter_spec.ts
@@ -16,7 +16,7 @@ import { buildSupportCodeLibrary } from '../../test/runtime_helpers'
import { getBaseSupportCodeLibrary } from '../../test/fixtures/steps'
import timeMethods from '../time'
import { IRuntimeOptions } from '../runtime'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { doesHaveValue, doesNotHaveValue } from '../value_checker'
import ProgressBarFormatter from './progress_bar_formatter'
import FormatterBuilder from './builder'
@@ -26,7 +26,7 @@ interface ITestProgressBarFormatterOptions {
runtimeOptions?: Partial
shouldStopFn: (envelope: messages.Envelope) => boolean
sources?: ITestSource[]
- supportCodeLibrary?: ISupportCodeLibrary
+ supportCodeLibrary?: SupportCodeLibrary
pickleFilter?: (pickle: messages.Pickle) => boolean
}
diff --git a/src/index.ts b/src/index.ts
index 1e79e222f..9bb795739 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,12 @@
+/**
+ * User code functions and helpers
+ *
+ * @packageDocumentation
+ * @module (root)
+ * @remarks
+ * These docs cover the functions and helpers for user code registration and test setup. The entry point is `@cucumber/cucumber`.
+ */
+
import { deprecate } from 'node:util'
import * as messages from '@cucumber/messages'
import { default as _Cli } from './cli'
@@ -61,28 +70,28 @@ export { wrapPromiseWithTimeout } from './time'
// Deprecated
/**
- * @deprecated use `runCucumber` instead; see
+ * @deprecated use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md
*/
export const Cli = deprecate(
_Cli,
'`Cli` is deprecated, use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'
)
/**
- * @deprecated use `loadSources` instead; see
+ * @deprecated use `loadSources` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md
*/
export const parseGherkinMessageStream = deprecate(
cliHelpers.parseGherkinMessageStream,
'`parseGherkinMessageStream` is deprecated, use `loadSources` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'
)
/**
- * @deprecated use `loadSources` instead; see
+ * @deprecated use `loadSources` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md
*/
export const PickleFilter = deprecate(
_PickleFilter,
'`PickleFilter` is deprecated, use `loadSources` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'
)
/**
- * @deprecated use `runCucumber` instead; see
+ * @deprecated use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md
*/
export const Runtime = deprecate(
_Runtime,
diff --git a/src/models/pickle_order.ts b/src/models/pickle_order.ts
deleted file mode 100644
index d3fc77e0e..000000000
--- a/src/models/pickle_order.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type PickleOrder = 'defined' | 'random' | string
diff --git a/src/publish/index.ts b/src/publish/index.ts
index c22c3eff0..3c31a084b 100644
--- a/src/publish/index.ts
+++ b/src/publish/index.ts
@@ -1,3 +1,4 @@
import { publishPlugin } from './publish_plugin'
export default publishPlugin
+export * from './types'
diff --git a/src/publish/publish_plugin.ts b/src/publish/publish_plugin.ts
index 07810a773..97dbbdc13 100644
--- a/src/publish/publish_plugin.ts
+++ b/src/publish/publish_plugin.ts
@@ -3,7 +3,7 @@ import { supportsColor } from 'supports-color'
import hasAnsi from 'has-ansi'
import stripAnsi from 'strip-ansi'
import { InternalPlugin } from '../plugin'
-import { IPublishConfig } from '../formatter'
+import { IPublishConfig } from './types'
import HttpStream from './http_stream'
const DEFAULT_CUCUMBER_PUBLISH_URL = 'https://messages.cucumber.io/api/reports'
diff --git a/src/publish/types.ts b/src/publish/types.ts
new file mode 100644
index 000000000..d65f72b54
--- /dev/null
+++ b/src/publish/types.ts
@@ -0,0 +1,14 @@
+/**
+ * Options relating to publication to https://reports.cucumber.io
+ * @public
+ */
+export interface IPublishConfig {
+ /**
+ * Base URL for the Cucumber Reports service
+ */
+ url: string
+ /**
+ * Access token for the Cucumber Reports service
+ */
+ token: string
+}
diff --git a/src/runtime/assemble_test_cases.ts b/src/runtime/assemble_test_cases.ts
index be4b80aa4..bab2993e1 100644
--- a/src/runtime/assemble_test_cases.ts
+++ b/src/runtime/assemble_test_cases.ts
@@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events'
import * as messages from '@cucumber/messages'
import { IdGenerator } from '@cucumber/messages'
import { Group } from '@cucumber/cucumber-expressions'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { doesHaveValue } from '../value_checker'
export declare type IAssembledTestCases = Record
@@ -11,7 +11,7 @@ export interface IAssembleTestCasesOptions {
eventBroadcaster: EventEmitter
newId: IdGenerator.NewId
pickles: messages.Pickle[]
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
export async function assembleTestCases({
@@ -59,7 +59,7 @@ function makeAfterHookSteps({
pickle,
newId,
}: {
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
pickle: messages.Pickle
newId: IdGenerator.NewId
}): messages.TestStep[] {
@@ -78,7 +78,7 @@ function makeBeforeHookSteps({
pickle,
newId,
}: {
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
pickle: messages.Pickle
newId: IdGenerator.NewId
}): messages.TestStep[] {
@@ -96,7 +96,7 @@ function makeSteps({
newId,
}: {
pickle: messages.Pickle
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
newId: () => string
}): messages.TestStep[] {
return pickle.steps.map((pickleStep) => {
diff --git a/src/runtime/assemble_test_cases_spec.ts b/src/runtime/assemble_test_cases_spec.ts
index 99a8326db..eaee9418f 100644
--- a/src/runtime/assemble_test_cases_spec.ts
+++ b/src/runtime/assemble_test_cases_spec.ts
@@ -7,13 +7,13 @@ import { expect } from 'chai'
import timeMethods from '../time'
import { buildSupportCodeLibrary } from '../../test/runtime_helpers'
import { parse } from '../../test/gherkin_helpers'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { assembleTestCases, IAssembledTestCases } from './assemble_test_cases'
interface IRequest {
gherkinDocument: messages.GherkinDocument
pickles: messages.Pickle[]
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
interface IResponse {
diff --git a/src/runtime/index.ts b/src/runtime/index.ts
index 035232336..f615db482 100644
--- a/src/runtime/index.ts
+++ b/src/runtime/index.ts
@@ -3,7 +3,7 @@ import * as messages from '@cucumber/messages'
import { IdGenerator } from '@cucumber/messages'
import { JsonObject } from 'type-fest'
import { EventDataCollector } from '../formatter/helpers'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { assembleTestCases } from './assemble_test_cases'
import { retriesForPickle, shouldCauseFailure } from './helpers'
import { makeRunTestRunHooks, RunsTestRunHooks } from './run_test_run_hooks'
@@ -20,7 +20,7 @@ export interface INewRuntimeOptions {
newId: IdGenerator.NewId
options: IRuntimeOptions
pickleIds: string[]
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
export interface IRuntimeOptions {
@@ -40,7 +40,7 @@ export default class Runtime implements IRuntime {
private readonly newId: IdGenerator.NewId
private readonly options: IRuntimeOptions
private readonly pickleIds: string[]
- private readonly supportCodeLibrary: ISupportCodeLibrary
+ private readonly supportCodeLibrary: SupportCodeLibrary
private success: boolean
private runTestRunHooks: RunsTestRunHooks
diff --git a/src/runtime/parallel/coordinator.ts b/src/runtime/parallel/coordinator.ts
index f52e715bc..29a25b485 100644
--- a/src/runtime/parallel/coordinator.ts
+++ b/src/runtime/parallel/coordinator.ts
@@ -6,7 +6,7 @@ import { IdGenerator } from '@cucumber/messages'
import { retriesForPickle, shouldCauseFailure } from '../helpers'
import { EventDataCollector } from '../../formatter/helpers'
import { IRuntime, IRuntimeOptions } from '..'
-import { ISupportCodeLibrary } from '../../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../support_code_library_builder/types'
import { doesHaveValue } from '../../value_checker'
import { IStopwatch, create } from '../stopwatch'
import { assembleTestCases, IAssembledTestCases } from '../assemble_test_cases'
@@ -23,7 +23,7 @@ export interface INewCoordinatorOptions {
options: IRuntimeOptions
newId: IdGenerator.NewId
pickleIds: string[]
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
requireModules: string[]
requirePaths: string[]
importPaths: string[]
@@ -60,7 +60,7 @@ export default class Coordinator implements IRuntime {
private assembledTestCases: IAssembledTestCases
private inProgressPickles: Record
private workers: Record
- private readonly supportCodeLibrary: ISupportCodeLibrary
+ private readonly supportCodeLibrary: SupportCodeLibrary
private readonly requireModules: string[]
private readonly requirePaths: string[]
private readonly importPaths: string[]
diff --git a/src/runtime/parallel/worker.ts b/src/runtime/parallel/worker.ts
index f017764d4..495a7c3c3 100644
--- a/src/runtime/parallel/worker.ts
+++ b/src/runtime/parallel/worker.ts
@@ -4,7 +4,7 @@ import * as messages from '@cucumber/messages'
import { IdGenerator } from '@cucumber/messages'
import { JsonObject } from 'type-fest'
import supportCodeLibraryBuilder from '../../support_code_library_builder'
-import { ISupportCodeLibrary } from '../../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../support_code_library_builder/types'
import { doesHaveValue } from '../../value_checker'
import { makeRunTestRunHooks, RunsTestRunHooks } from '../run_test_run_hooks'
import { create } from '../stopwatch'
@@ -31,7 +31,7 @@ export default class Worker {
private filterStacktraces: boolean
private readonly newId: IdGenerator.NewId
private readonly sendMessage: IMessageSender
- private supportCodeLibrary: ISupportCodeLibrary
+ private supportCodeLibrary: SupportCodeLibrary
private worldParameters: JsonObject
private runTestRunHooks: RunsTestRunHooks
diff --git a/src/runtime/test_case_runner.ts b/src/runtime/test_case_runner.ts
index a27abd2a0..566e44a85 100644
--- a/src/runtime/test_case_runner.ts
+++ b/src/runtime/test_case_runner.ts
@@ -3,7 +3,7 @@ import * as messages from '@cucumber/messages'
import { getWorstTestStepResult, IdGenerator } from '@cucumber/messages'
import { JsonObject } from 'type-fest'
import {
- ISupportCodeLibrary,
+ SupportCodeLibrary,
ITestCaseHookParameter,
ITestStepHookParameter,
} from '../support_code_library_builder/types'
@@ -27,7 +27,7 @@ export interface INewTestCaseRunnerOptions {
retries: number
skip: boolean
filterStackTraces: boolean
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
worldParameters: JsonObject
}
@@ -44,7 +44,7 @@ export default class TestCaseRunner {
private readonly maxAttempts: number
private readonly skip: boolean
private readonly filterStackTraces: boolean
- private readonly supportCodeLibrary: ISupportCodeLibrary
+ private readonly supportCodeLibrary: SupportCodeLibrary
private testStepResults: messages.TestStepResult[]
private world: any
private readonly worldParameters: JsonObject
@@ -357,7 +357,7 @@ export default class TestCaseRunner {
function findHookDefinition(
id: string,
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
): TestCaseHookDefinition {
return [
...supportCodeLibrary.beforeTestCaseHookDefinitions,
@@ -367,7 +367,7 @@ function findHookDefinition(
function findStepDefinition(
id: string,
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
): StepDefinition {
return supportCodeLibrary.stepDefinitions.find(
(definition) => definition.id === id
diff --git a/src/runtime/test_case_runner_spec.ts b/src/runtime/test_case_runner_spec.ts
index e4b7485d1..87d1e861b 100644
--- a/src/runtime/test_case_runner_spec.ts
+++ b/src/runtime/test_case_runner_spec.ts
@@ -9,7 +9,7 @@ import { buildSupportCodeLibrary } from '../../test/runtime_helpers'
import { parse } from '../../test/gherkin_helpers'
import timeMethods from '../time'
import { getBaseSupportCodeLibrary } from '../../test/fixtures/steps'
-import { ISupportCodeLibrary } from '../support_code_library_builder/types'
+import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { valueOrDefault } from '../value_checker'
import TestCaseRunner from './test_case_runner'
import { create } from './stopwatch'
@@ -21,7 +21,7 @@ interface ITestRunnerRequest {
pickle: messages.Pickle
retries?: number
skip?: boolean
- supportCodeLibrary: ISupportCodeLibrary
+ supportCodeLibrary: SupportCodeLibrary
}
interface ITestRunnerResponse {
diff --git a/src/support_code_library_builder/index.ts b/src/support_code_library_builder/index.ts
index 04229190f..1ea4f6840 100644
--- a/src/support_code_library_builder/index.ts
+++ b/src/support_code_library_builder/index.ts
@@ -23,7 +23,7 @@ import {
IDefineTestStepHookOptions,
IDefineTestRunHookOptions,
IParameterTypeDefinition,
- ISupportCodeLibrary,
+ SupportCodeLibrary,
TestCaseHookFunction,
TestStepHookFunction,
ParallelAssignmentValidator,
@@ -413,7 +413,7 @@ export class SupportCodeLibraryBuilder {
return { stepDefinitions, undefinedParameterTypes }
}
- finalize(canonicalIds?: ICanonicalSupportCodeIds): ISupportCodeLibrary {
+ finalize(canonicalIds?: ICanonicalSupportCodeIds): SupportCodeLibrary {
const stepDefinitionsResult = this.buildStepDefinitions(
canonicalIds?.stepDefinitionIds
)
diff --git a/src/support_code_library_builder/types.ts b/src/support_code_library_builder/types.ts
index ec2690321..28d4fd2c3 100644
--- a/src/support_code_library_builder/types.ts
+++ b/src/support_code_library_builder/types.ts
@@ -150,7 +150,7 @@ export interface ISupportCodeCoordinates {
importPaths: string[]
}
-export interface ISupportCodeLibrary {
+export interface SupportCodeLibrary {
readonly originalCoordinates: ISupportCodeCoordinates
readonly afterTestCaseHookDefinitions: TestCaseHookDefinition[]
readonly afterTestStepHookDefinitions: TestStepHookDefinition[]
diff --git a/test/fixtures/json_formatter_steps.ts b/test/fixtures/json_formatter_steps.ts
index a8d709c6c..40b753140 100644
--- a/test/fixtures/json_formatter_steps.ts
+++ b/test/fixtures/json_formatter_steps.ts
@@ -2,12 +2,12 @@
import { InstalledClock } from '@sinonjs/fake-timers'
import { buildSupportCodeLibrary } from '../runtime_helpers'
-import { ISupportCodeLibrary } from '../../src/support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../src/support_code_library_builder/types'
import { World } from '../../src'
export function getJsonFormatterSupportCodeLibrary(
clock: InstalledClock
-): ISupportCodeLibrary {
+): SupportCodeLibrary {
return buildSupportCodeLibrary(__dirname, ({ Given }) => {
Given('a passing step', function () {
clock.tick(1)
@@ -51,7 +51,7 @@ export function getJsonFormatterSupportCodeLibrary(
})
}
-export function getJsonFormatterSupportCodeLibraryWithHooks(): ISupportCodeLibrary {
+export function getJsonFormatterSupportCodeLibraryWithHooks(): SupportCodeLibrary {
return buildSupportCodeLibrary(__dirname, ({ After, Before, Given }) => {
Given('a passing step', function () {}) // eslint-disable-line @typescript-eslint/no-empty-function
Before(function () {}) // eslint-disable-line @typescript-eslint/no-empty-function
diff --git a/test/fixtures/steps.ts b/test/fixtures/steps.ts
index 082e10bac..e3306e427 100644
--- a/test/fixtures/steps.ts
+++ b/test/fixtures/steps.ts
@@ -1,10 +1,10 @@
// Tests depend on the lines the steps are defined on
import { buildSupportCodeLibrary } from '../runtime_helpers'
-import { ISupportCodeLibrary } from '../../src/support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../src/support_code_library_builder/types'
import World from '../../src/support_code_library_builder/world'
-export function getBaseSupportCodeLibrary(): ISupportCodeLibrary {
+export function getBaseSupportCodeLibrary(): SupportCodeLibrary {
return buildSupportCodeLibrary(__dirname, ({ Given }) => {
Given('a failing step', function () {
throw 'error' // eslint-disable-line @typescript-eslint/no-throw-literal
diff --git a/test/fixtures/usage_steps.ts b/test/fixtures/usage_steps.ts
index 28078b2cf..62779e243 100644
--- a/test/fixtures/usage_steps.ts
+++ b/test/fixtures/usage_steps.ts
@@ -2,11 +2,11 @@
import { InstalledClock } from '@sinonjs/fake-timers'
import { buildSupportCodeLibrary } from '../runtime_helpers'
-import { ISupportCodeLibrary } from '../../src/support_code_library_builder/types'
+import { SupportCodeLibrary } from '../../src/support_code_library_builder/types'
export function getUsageSupportCodeLibrary(
clock: InstalledClock
-): ISupportCodeLibrary {
+): SupportCodeLibrary {
return buildSupportCodeLibrary(__dirname, ({ Given }) => {
Given('abc', function () {
clock.tick(1)
diff --git a/test/formatter_helpers.ts b/test/formatter_helpers.ts
index f769ada5f..65a2af137 100644
--- a/test/formatter_helpers.ts
+++ b/test/formatter_helpers.ts
@@ -6,7 +6,7 @@ import * as messages from '@cucumber/messages'
import Runtime, { IRuntimeOptions } from '../src/runtime'
import { EventDataCollector } from '../src/formatter/helpers'
import FormatterBuilder from '../src/formatter/builder'
-import { ISupportCodeLibrary } from '../src/support_code_library_builder/types'
+import { SupportCodeLibrary } from '../src/support_code_library_builder/types'
import { ITestCaseAttempt } from '../src/formatter/helpers/event_data_collector'
import { doesNotHaveValue } from '../src/value_checker'
import { emitSupportCodeMessages } from '../src/cli/helpers'
@@ -23,7 +23,7 @@ export interface ITestSource {
export interface ITestRunOptions {
runtimeOptions?: Partial
- supportCodeLibrary?: ISupportCodeLibrary
+ supportCodeLibrary?: SupportCodeLibrary
sources?: ITestSource[]
pickleFilter?: (pickle: messages.Pickle) => boolean
}
diff --git a/test/runtime_helpers.ts b/test/runtime_helpers.ts
index 9d7d13e49..5b9acc70f 100644
--- a/test/runtime_helpers.ts
+++ b/test/runtime_helpers.ts
@@ -3,7 +3,7 @@ import { SupportCodeLibraryBuilder } from '../src/support_code_library_builder'
import { IRuntimeOptions } from '../src/runtime'
import {
IDefineSupportCodeMethods,
- ISupportCodeLibrary,
+ SupportCodeLibrary,
} from '../src/support_code_library_builder/types'
import { doesHaveValue } from '../src/value_checker'
@@ -27,7 +27,7 @@ type DefineSupportCodeFunction = (methods: IDefineSupportCodeMethods) => void
export function buildSupportCodeLibrary(
cwd: string | DefineSupportCodeFunction = __dirname,
fn: DefineSupportCodeFunction = null
-): ISupportCodeLibrary {
+): SupportCodeLibrary {
if (typeof cwd === 'function') {
fn = cwd
cwd = __dirname
diff --git a/typedoc.json b/typedoc.json
new file mode 100644
index 000000000..254317af4
--- /dev/null
+++ b/typedoc.json
@@ -0,0 +1,13 @@
+{
+ "customTitle": "cucumber-js",
+ "entryPoints": ["src/index.ts", "src/api/index.ts"],
+ "favicon": "./docs/images/logo.svg",
+ "footerLastModified": true,
+ "navigationLinks": {
+ "GitHub": "https://github.com/cucumber/cucumber-js"
+ },
+ "out": "./_site",
+ "plugin": ["typedoc-plugin-extras"],
+ "readme": "none",
+ "tsconfig": "tsconfig.node.json"
+}