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

feat(port): remove port config key #1386

Merged
merged 2 commits into from
Feb 12, 2019
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
1 change: 0 additions & 1 deletion packages/stryker-api/src/config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default class Config implements StrykerOptions {
public transpilers: string[] = [];
public maxConcurrentTestRunners: number = Infinity;
public symlinkNodeModules: boolean = true;
public port: number | undefined = undefined;
public thresholds: MutationScoreThresholds = {
break: null,
high: 80,
Expand Down
6 changes: 0 additions & 6 deletions packages/stryker-api/src/core/StrykerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ interface StrykerOptions {
*/
plugins: string[];

/**
* DEPRECATED
* @deprecated Test runners are expected to manage their own port selection. I.E. Please use karma.config.port
*/
port?: number;

/**
* Indicates whether or not to use colors in console.
* Default: true
Expand Down
15 changes: 0 additions & 15 deletions packages/stryker/src/config/ConfigValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { MutatorDescriptor, MutationScoreThresholds, LogLevel, StrykerOptions }
import { Config } from 'stryker-api/config';
import { Logger } from 'stryker-api/logging';
import { StrykerError } from '@stryker-mutator/util';
import { normalizeWhiteSpaces } from '../utils/objectUtils';
import { tokens, commonTokens } from 'stryker-api/plugin';
import { coreTokens } from '../di';

Expand All @@ -23,7 +22,6 @@ export default class ConfigValidator {
this.validateLogLevel('logLevel');
this.validateLogLevel('fileLogLevel');
this.validateTimeout();
this.validatePort();
this.validateIsNumber('maxConcurrentTestRunners', this.options.maxConcurrentTestRunners);
this.validateIsStringArray('plugins', this.options.plugins);
this.validateIsStringArray('reporters', this.options.reporters);
Expand Down Expand Up @@ -62,15 +60,6 @@ export default class ConfigValidator {
}
}

public validatePort() {
if (this.options.port) {
this.validateIsNumber('port', this.options.port);
this.deprecate('port', normalizeWhiteSpaces(
`Test runners are expected to manage their own port selection.
I.e. please use karma.config.port, or leave it out entirely to let the test runner itself decide.`));
}
}

private validateThresholdValue(name: keyof MutationScoreThresholds, value: number | null) {
if (typeof value === 'number' && (value < 0 || value > 100)) {
this.invalidate(`Value "${value}" is invalid for \`thresholds.${name}\`. Expected a number between 0 and 100`);
Expand Down Expand Up @@ -149,10 +138,6 @@ export default class ConfigValidator {
this.isValid = false;
}

private deprecate(deprecatedOption: keyof StrykerOptions, message: string) {
this.log.warn(`Stryker option "${deprecatedOption}" is deprecated. ${message}`);
}

private joinQuotedList(arr: string[]) {
return arr.map(v => `"${v}"`).join(', ');
}
Expand Down