Skip to content

Commit

Permalink
feat(test-framework): remove TestFramework API
Browse files Browse the repository at this point in the history
Remove the test framework API and their implementations: `@stryker-mutator/jasmine-framework` and `@stryker-mutator/mocha-framework`. Test runners are now expected to cary their own support for different test frameworks they might support.

A `TestFramework` provided decoupling between the framework and the test runner itself. It was used to provide test filtering and `perTest` coverage analysis. Historically, this decoupling only came in use for `karma`, since that is the only test runner that supports multiple test frameworks. Support for filtering `mocha` and `jasmine` tests is now build into the `@stryker-mutator/karma-runner` itself, as well as the other supported test runners.

Therefore this API is no longer used, which makes it easier to configure Stryker and easier to maintain.
  • Loading branch information
nicojs committed Jul 10, 2020
1 parent 9267b6f commit fe5e200
Show file tree
Hide file tree
Showing 28 changed files with 6 additions and 537 deletions.
2 changes: 0 additions & 2 deletions packages/api/config.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/api/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export * from './src-generated/stryker-core';
export * from './src/core/ReportTypes';
export * from './src/core/StrykerOptionsSchema';
export * from './src/core/PartialStrykerOptions';
export * from './src/core/OptionsEditor';
12 changes: 0 additions & 12 deletions packages/api/src/plugin/Contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ export interface OptionsContext extends BaseContext {
[commonTokens.mutatorDescriptor]: MutatorDescriptor;
}

/**
* The dependency injection context for a `TranspilerPlugin`
*/
export interface TranspilerPluginContext extends OptionsContext {
[commonTokens.produceSourceMaps]: boolean;
}

/**
* The dependency injection context for a `TestRunnerPlugin`
*/
Expand All @@ -41,13 +34,8 @@ export interface TestRunnerPluginContext extends OptionsContext {
* Lookup type for plugin contexts by kind.
*/
export interface PluginContexts {
[PluginKind.ConfigEditor]: BaseContext;
[PluginKind.OptionsEditor]: BaseContext;
[PluginKind.Mutator]: OptionsContext;
[PluginKind.Reporter]: OptionsContext;
[PluginKind.TestFramework]: OptionsContext;
[PluginKind.TestRunner]: TestRunnerPluginContext;
[PluginKind.TestRunner2]: TestRunnerPluginContext;
[PluginKind.Transpiler]: TranspilerPluginContext;
[PluginKind.Checker]: OptionsContext;
}
8 changes: 0 additions & 8 deletions packages/api/src/plugin/PluginKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
* The plugin kinds supported by Stryker
*/
export enum PluginKind {
/**
* @deprecated, please use `OptionsEditor`
*/
ConfigEditor = 'ConfigEditor',
OptionsEditor = 'OptionsEditor',
Checker = 'Checker',
TestRunner = 'TestRunner',
TestRunner2 = 'TestRunner2',
TestFramework = 'TestFramework',
Transpiler = 'Transpiler',
Mutator = 'Mutator',
Reporter = 'Reporter',
}
10 changes: 0 additions & 10 deletions packages/api/src/plugin/Plugins.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { InjectableClass, InjectableFunction, InjectionToken } from 'typed-inject';

import { ConfigEditor } from '../../config';
import { Mutator } from '../../mutant';
import { Reporter } from '../../report';
import { TestFramework } from '../../test_framework';
import { TestRunner } from '../../test_runner';
import { Transpiler } from '../../transpile';
import { OptionsEditor } from '../core/OptionsEditor';
import { TestRunner2 } from '../../test_runner2';
import { Checker } from '../../check';

Expand Down Expand Up @@ -85,14 +80,9 @@ export function declareFactoryPlugin<TPluginKind extends PluginKind, Tokens exte
* Lookup type for plugin interfaces by kind.
*/
export interface PluginInterfaces {
[PluginKind.ConfigEditor]: ConfigEditor;
[PluginKind.OptionsEditor]: OptionsEditor;
[PluginKind.Mutator]: Mutator;
[PluginKind.Reporter]: Reporter;
[PluginKind.TestFramework]: TestFramework;
[PluginKind.TestRunner]: TestRunner;
[PluginKind.TestRunner2]: TestRunner2;
[PluginKind.Transpiler]: Transpiler;
[PluginKind.Checker]: Checker;
}

Expand Down
30 changes: 0 additions & 30 deletions packages/api/src/test_framework/TestFramework.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/api/src/test_framework/TestSelection.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/api/test_framework.ts

This file was deleted.

21 changes: 4 additions & 17 deletions packages/jasmine-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
"description": "A plugin to use the Jasmine test framework in Stryker, the JavaScript mutation testing framework",
"main": "src/index.js",
"scripts": {
"test": "nyc --exclude-after-remap=false --check-coverage --reporter=html --report-dir=reports/coverage --lines 100 --functions 100 --branches 100 npm run mocha",
"mocha": "mocha \"test/helpers/**/*.js\" \"test/unit/**/*.js\" && mocha --timeout 10000 \"test/helpers/**/*.js\" \"test/integration/**/*.js\"",
"stryker": "node ../core/bin/stryker run"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/stryker-mutator/stryker.git"
},
"keywords": [
"stryker",
"jasmine",
"@stryker-mutator/test-framework-plugin",
"@stryker-mutator/karma-runner",
"@stryker-mutator/jasmine-runner"
"jasmine"
],
"publishConfig": {
"access": "public"
Expand All @@ -28,18 +22,11 @@
"url": "https://github.com/stryker-mutator/stryker/issues"
},
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/jasmine#readme",
"peerDependencies": {
"@stryker-mutator/core": "^3.0.0",
"jasmine-core": ">=2"
},
"dependencies": {
"@stryker-mutator/api": "^3.3.1"
},
"peerDependencies": {},
"dependencies": {},
"contributors": [],
"engines": {
"node": ">=10"
},
"devDependencies": {
"@types/node": "^14.0.1"
}
"devDependencies": {}
}
41 changes: 0 additions & 41 deletions packages/jasmine-framework/src/JasmineTestFramework.ts

This file was deleted.

6 changes: 1 addition & 5 deletions packages/jasmine-framework/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import { declareClassPlugin, PluginKind } from '@stryker-mutator/api/plugin';

import JasmineTestFramework from './JasmineTestFramework';

export const strykerPlugins = [declareClassPlugin(PluginKind.TestFramework, 'jasmine', JasmineTestFramework)];
console.warn('Framework plugins are no longer needed in Stryker 4.0. Please remove "@stryker-mutator/jasmine-framework" from your devDependencies.');
5 changes: 0 additions & 5 deletions packages/jasmine-framework/stryker.conf.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/jasmine-framework/test/helpers/initChai.ts

This file was deleted.

96 changes: 0 additions & 96 deletions packages/jasmine-framework/test/integration/nestedSuite.it.spec.ts

This file was deleted.

35 changes: 0 additions & 35 deletions packages/jasmine-framework/test/unit/JasmineTestFramework.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/jasmine-framework/test/unit/index.spec.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/jasmine-framework/testResources/json-reporter.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/jasmine-framework/testResources/nested-suite.js

This file was deleted.

Loading

0 comments on commit fe5e200

Please sign in to comment.