Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Added IPublishConfig interface for use in makePublishConfig #2106

Merged
merged 1 commit into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
export interface IPublishConfig {
url: string
token: string
}

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