Skip to content

Commit

Permalink
fix: add IPublishConfig interface for use in makePublishConfig (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Manny committed Aug 9, 2022
1 parent a52e1e5 commit 21a3e6c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) on how to contribute to Cucumber.

## [Unreleased]
### Added
- `IPublishConfig` interface for use in return type of `makePublishConfig` instead of explicit `any` ([#1648](https://github.com/cucumber/cucumber-js/pull/2106))

## [8.5.1] - 2022-07-28
### Fixed
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -100,6 +100,7 @@
"Łukasz Gandecki <lgandecki@css.edu>",
"M.P. Korstanje <mpkorstanje@users.noreply.github.com>",
"mannyluvstacos <mannyis@typingona.computer>",
"Manny Pamintuan <mannyis+still@typingona.computer>",
"Marat Dyatko <vectart@gmail.com>",
"Marc Burton <marc.burton@first-utility.com>",
"Marcel Hoyer <mhoyer@pixelplastic.de>",
Expand Down
3 changes: 2 additions & 1 deletion src/api/convert_configuration.ts
Expand Up @@ -3,6 +3,7 @@ import {
isTruthyString,
OptionSplitter,
} from '../configuration'
import { IPublishConfig } from '../formatter/publish'
import { IRunConfiguration } from './types'

export async function convertConfiguration(
Expand Down Expand Up @@ -63,7 +64,7 @@ function convertFormats(
function makePublishConfig(
flatConfiguration: IConfiguration,
env: NodeJS.ProcessEnv
): any {
): IPublishConfig | false {
const enabled = isPublishing(flatConfiguration, env)
if (!enabled) {
return false
Expand Down
8 changes: 2 additions & 6 deletions src/api/types.ts
Expand Up @@ -3,6 +3,7 @@ import { FormatOptions, IFormatterStream } from '../formatter'
import { PickleOrder } from '../models/pickle_order'
import { IRuntimeOptions } from '../runtime'
import { IConfiguration } from '../configuration'
import { IPublishConfig } from '../formatter/publish'

/**
* @public
Expand Down Expand Up @@ -109,12 +110,7 @@ export interface IRunOptionsRuntime extends IRuntimeOptions {
export interface IRunOptionsFormats {
stdout: string
files: Record<string, string>
publish:
| {
url?: string
token?: string
}
| false
publish: IPublishConfig | false
options: FormatOptions
}

Expand Down
5 changes: 5 additions & 0 deletions src/formatter/publish.ts
@@ -1,2 +1,7 @@
export interface IPublishConfig {
url: string
token: string
}

export const DEFAULT_CUCUMBER_PUBLISH_URL =
'https://messages.cucumber.io/api/reports'

0 comments on commit 21a3e6c

Please sign in to comment.