Skip to content

Commit

Permalink
feat(checker): add checker api
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs committed Jun 1, 2020
1 parent 8df9172 commit 8907f94
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/api/check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './src/checker/Check';
export * from './src/checker/CheckResult';
9 changes: 9 additions & 0 deletions packages/api/src/checker/Check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Mutant } from '../../mutant';

import { CheckResult } from './CheckResult';

export interface Checker {
initialize(): Promise<void>;

check(mutant: Mutant): Promise<CheckResult>;
}
6 changes: 6 additions & 0 deletions packages/api/src/checker/CheckResult.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import MutantStatus from '../report/MutantStatus';

export interface CheckResult {
reason?: string;
mutantResult: MutantStatus;
}
1 change: 1 addition & 0 deletions packages/api/src/plugin/Contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ export interface PluginContexts {
[PluginKind.TestFramework]: OptionsContext;
[PluginKind.TestRunner]: TestRunnerPluginContext;
[PluginKind.Transpiler]: TranspilerPluginContext;
[PluginKind.Checker]: OptionsContext;
}
1 change: 1 addition & 0 deletions packages/api/src/plugin/PluginKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum PluginKind {
*/
ConfigEditor = 'ConfigEditor',
OptionsEditor = 'OptionsEditor',
Checker = 'Checker',
TestRunner = 'TestRunner',
TestFramework = 'TestFramework',
Transpiler = 'Transpiler',
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/plugin/Plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TestFramework } from '../../test_framework';
import { TestRunner } from '../../test_runner';
import { Transpiler } from '../../transpile';
import { OptionsEditor } from '../core/OptionsEditor';
import { Checker } from '../../check';

import { PluginContexts } from './Contexts';
import { PluginKind } from './PluginKind';
Expand Down Expand Up @@ -90,6 +91,7 @@ export interface PluginInterfaces {
[PluginKind.TestFramework]: TestFramework;
[PluginKind.TestRunner]: TestRunner;
[PluginKind.Transpiler]: Transpiler;
[PluginKind.Checker]: Checker;
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/api/tsconfig.src.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"src",
"src-generated",
"schema/*.json",
"check.ts",
"config.ts",
"core.ts",
"logging.ts",
Expand Down

0 comments on commit 8907f94

Please sign in to comment.