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(ES5 support): remove ES5 mutator #1370

Merged
merged 4 commits into from
Feb 11, 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
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"devDependencies": {
"@types/chai": "4.1.7",
"@types/chai-as-promised": "7.1.0",
"@types/escodegen": "0.0.6",
"@types/esprima": "^2.1.31",
"@types/estree": "0.0.38",
"@types/execa": "^0.9.0",
"@types/glob": "^7.1.0",
"@types/istanbul": "^0.4.29",
Expand Down
2 changes: 1 addition & 1 deletion packages/stryker-api/src/config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class Config implements StrykerOptions {
public coverageAnalysis: 'perTest' | 'all' | 'off' = 'off';
public testRunner: string = 'command';
public testFramework: string;
public mutator: string | MutatorDescriptor = 'es5';
public mutator: string | MutatorDescriptor = 'javascript';
public transpilers: string[] = [];
public maxConcurrentTestRunners: number = Infinity;
public symlinkNodeModules: boolean = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/stryker-vue-mutator/src/helpers/MutatorHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function mutatorsFactory(pluginResolver: PluginResolver, injector: Inject
const mutators: { [name: string]: Mutator; } = {};
const mutatorPlugins = pluginResolver.resolveAll(PluginKind.Mutator);
mutatorPlugins.forEach(plugin => {
if (plugin.name !== 'es5' && plugin.name !== 'vue') {
if (plugin.name !== 'vue') {
mutators[plugin.name] = createPlugin(injector, plugin);
}
});
Expand Down
10 changes: 5 additions & 5 deletions packages/stryker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ In addition to requiring your test runner to be able to report the code coverage
(`Mocha` is not yet supported).

### `mutator` [`object` | `string`]
Default: `es5`
Command line: `--mutator es5`
Config file: `mutator: 'es5'` or `mutator: { name: 'es5', excludedMutations: ['BooleanSubstitution', 'StringLiteral'] }`
Default: `javascript`
Command line: `--mutator javascript`
Config file: `mutator: 'javascript'` or `mutator: { name: 'javascript', excludedMutations: ['BooleanSubstitution', 'StringLiteral'] }`

With `mutator` you configure which mutator plugin you want to use, and optionally, which mutation types to exclude from the test run.
The mutator plugin name defaults to `es5` if not specified. The list of excluded mutation types defaults to an empty array, meaning all mutation types will be included in the test.
The full list of mutation types varies slightly between mutators (for example, the `es5` mutator will not use the same mutation types as the `typescript` mutator). Mutation type names are case-sensitive, and can be found either in the source code or in a generated Stryker report.
The mutator plugin name defaults to `javascript` if not specified. Note: this requires you to have the `@stryker-mutator/javascript-mutator` plugin installed. The list of excluded mutation types defaults to an empty array, meaning all mutation types will be included in the test.
The full list of mutation types varies slightly between mutators (for example, the `javascript` mutator will not use the same mutation types as the `typescript` mutator). Mutation type names are case-sensitive, and can be found either in the source code or in a generated Stryker report.

When using the command line, only the mutator name as a string may be provided.
When using the config file, you can provide either a string representing the mutator name, or a `MutatorDescriptor` object, like so:
Expand Down
2 changes: 0 additions & 2 deletions packages/stryker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
"@stryker-mutator/util": "^0.1.0",
"chalk": "~2.4.1",
"commander": "~2.19.0",
"escodegen": "~1.8.0",
"esprima": "~2.7.0",
"get-port": "~4.1.0",
"glob": "~7.1.2",
"inquirer": "~6.2.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/stryker/src/di/buildMainInjector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export function buildMainInjector(cliOptions: Partial<StrykerOptions>): Injector

function pluginDescriptorsFactory(config: Config): ReadonlyArray<string> {
config.plugins.push(
require.resolve('../reporters'),
require.resolve('../mutators')
require.resolve('../reporters')
);
return config.plugins;
}
Expand Down
26 changes: 0 additions & 26 deletions packages/stryker/src/mutators/ArrayDeclaratorMutator.ts

This file was deleted.

42 changes: 0 additions & 42 deletions packages/stryker/src/mutators/BinaryOperatorMutator.ts

This file was deleted.

21 changes: 0 additions & 21 deletions packages/stryker/src/mutators/BlockStatementMutator.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/stryker/src/mutators/BooleanSubstitutionMutator.ts

This file was deleted.

80 changes: 0 additions & 80 deletions packages/stryker/src/mutators/ES5Mutator.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/stryker/src/mutators/IdentifiedNode.ts

This file was deleted.

26 changes: 0 additions & 26 deletions packages/stryker/src/mutators/LogicalOperatorMutator.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/stryker/src/mutators/NodeMutator.ts

This file was deleted.

49 changes: 0 additions & 49 deletions packages/stryker/src/mutators/RemoveConditionalsMutator.ts

This file was deleted.

25 changes: 0 additions & 25 deletions packages/stryker/src/mutators/UnaryOperatorMutator.ts

This file was deleted.

Loading