stryker-api
Advanced tools
Comparing version 0.3.0-0 to 0.3.0-rc1
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"files": { | ||
@@ -3,0 +4,0 @@ "exclude": { |
{ | ||
"name": "stryker-api", | ||
"version": "0.3.0-0", | ||
"version": "0.3.0-rc1", | ||
"description": "The api for the extendable JavaScript mutation testing framework Stryker", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -15,3 +15,3 @@ [![Build Status](https://travis-ci.org/stryker-mutator/stryker.svg?branch=master)](https://travis-ci.org/stryker-mutator/stryker-api) | ||
2. Create a custom `Reporter` | ||
3. Create a `TestSelector` for a test framework | ||
3. Create a `TestFramework` for a test framework | ||
4. Create a `TestRunner` to bridge the gap between your test runner and Stryker | ||
@@ -18,0 +18,0 @@ 5. Create a custom way of configuring Stryker by creating a `ConfigWriter` |
@@ -31,6 +31,2 @@ import InputFileDescriptor from './InputFileDescriptor'; | ||
/** | ||
* The name of the test selector to use | ||
*/ | ||
testSelector?: string; | ||
/** | ||
* The name of the test runner to use (default is the same name as the testFramework) | ||
@@ -40,2 +36,11 @@ */ | ||
/** | ||
* Indicates which coverage analysis strategy to use. | ||
* During mutation testion, stryker will try to only run the tests that cover a particular line of code. | ||
* | ||
* 'perTest' (default): Analyse coverage per test. | ||
* 'all': Analyse the coverage for the entire test suite. | ||
* 'off': Don't use coverage analysis | ||
*/ | ||
coverageAnalysis?: 'perTest' | 'all' | 'off'; | ||
/** | ||
* The name (or names) of the reporter to use | ||
@@ -42,0 +47,0 @@ * Possible values: 'clear-text', 'progress'. |
@@ -0,1 +1,2 @@ | ||
import 'estree'; | ||
declare module 'estree' { | ||
@@ -204,2 +205,1 @@ interface Identifier { | ||
} | ||
export {}; |
"use strict"; | ||
require('estree'); | ||
//# sourceMappingURL=estree.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
/** | ||
* Represents a Factory for TestSelectors. | ||
* Represents a Factory for TestFrameworks. | ||
*/ | ||
@@ -14,0 +14,0 @@ var MutatorFactory = (function (_super) { |
@@ -19,27 +19,2 @@ import { Location } from '../../core'; | ||
s: CoverageData; | ||
/** | ||
* The coverage data for the branches | ||
*/ | ||
b?: BrancheCoverageData; | ||
/** | ||
* Hash of function counts, where keys are function IDs | ||
*/ | ||
f?: CoverageData; | ||
/** | ||
* Hash of line counts, where keys are the line number. | ||
*/ | ||
l?: CoverageData; | ||
/** | ||
* The FunctionMap | ||
*/ | ||
fnMap?: FunctionMap; | ||
/** | ||
* The BranchMap | ||
*/ | ||
branchMap?: BranchMap; | ||
/** | ||
* The StatementMap | ||
*/ | ||
statementMap: StatementMap; | ||
path?: string; | ||
} | ||
@@ -54,42 +29,2 @@ /** | ||
/** | ||
* Hash of branch counts, where keys are branch IDs and values are arrays of counts. | ||
* For an if statement, the value would have two counts; one for the if, and one for the else. | ||
* Switch statements would have an array of values for each case. | ||
*/ | ||
export interface BrancheCoverageData { | ||
[ref: string]: [number, number]; | ||
} | ||
/** | ||
* Hash of functions where keys are function IDs, and values are {name, line, loc, skip}, where name is the name of the function, | ||
* line is the line the function is declared on, and loc is the Location of the function declaration (just the declaration, not the entire function body) | ||
*/ | ||
export interface FunctionMap { | ||
[ref: string]: FunctionDescription; | ||
} | ||
/** | ||
* The description of a function. | ||
*/ | ||
export interface FunctionDescription { | ||
name: string; | ||
line: number; | ||
loc: Location; | ||
} | ||
/** | ||
* Hash where keys are branch IDs, and values are {line, type, locations} objects. | ||
* line is the line the branch starts on. type is the type of the branch (e.g. "if", "switch"). | ||
* locations is an array of Location objects, one for each possible outcome of the branch. | ||
* Note for an if statement where there is no else clause, there will still be two locations generated. | ||
*/ | ||
export interface BranchMap { | ||
[ref: string]: BranchDescription; | ||
} | ||
/** | ||
* The description of a branch. | ||
*/ | ||
export interface BranchDescription { | ||
line: number; | ||
type: string; | ||
locations: Location[]; | ||
} | ||
/** | ||
* Hash where keys are statement IDs, and values are Location objects for each statement. | ||
@@ -96,0 +31,0 @@ * The Location for a function definition is really an assignment, and should include the entire function. |
@@ -7,3 +7,3 @@ import { StrykerOptions, InputFile } from '../../core'; | ||
/** | ||
* A collection of paths to the files | ||
* The collection of files to load into the test runner in that exact order. | ||
*/ | ||
@@ -19,7 +19,3 @@ files: InputFile[]; | ||
strykerOptions: StrykerOptions; | ||
/** | ||
* Enable code coverage. When enabled, the calling party is interested in code coverage. | ||
*/ | ||
coverageEnabled?: boolean; | ||
} | ||
export default RunnerOptions; |
@@ -1,3 +0,3 @@ | ||
import { CoverageCollection } from './Coverage'; | ||
import TestResult from './TestResult'; | ||
import RunState from './RunState'; | ||
/** | ||
@@ -8,27 +8,14 @@ * Represents the result of a testrun. | ||
/** | ||
* The result of the test run. | ||
* The individual test results. | ||
*/ | ||
result: TestResult; | ||
tests: TestResult[]; | ||
/** | ||
* The names of the tests which were ran. | ||
* If `state` is `error`, this collection should contain the error messages | ||
*/ | ||
testNames?: string[]; | ||
errorMessages?: string[]; | ||
/** | ||
* The amount of tests that succeeded. | ||
* The state of the run | ||
*/ | ||
succeeded?: number; | ||
/** | ||
* The amount of tests that failed. | ||
*/ | ||
failed?: number; | ||
/** | ||
* The time that the test run took (in milliseconds). | ||
*/ | ||
timeSpent?: number; | ||
/** | ||
* The code coverage which may have been collected during the test run. | ||
*/ | ||
coverage?: CoverageCollection; | ||
errorMessages?: string[]; | ||
state: RunState; | ||
} | ||
export default RunResult; |
@@ -0,18 +1,28 @@ | ||
import TestState from './TestState'; | ||
import { CoverageCollection } from './Coverage'; | ||
/** | ||
* Indicates what the result of a test run was. | ||
* Indicates the result of single test | ||
*/ | ||
declare enum TestResult { | ||
interface TestResult { | ||
/** | ||
* The TestRunner was able to complete the run. NOTE: This can still mean that one or more tests failed. | ||
* The full human readable name of the test | ||
*/ | ||
Complete = 0, | ||
name: string; | ||
/** | ||
* The TestRunner was unable to complete the run due to an unexpected error. For example: the code contains a syntax error | ||
* The state of the test | ||
*/ | ||
Error = 1, | ||
state: TestState; | ||
/** | ||
* The TestRunner was unable to complete the test run fast enough. | ||
* Optional: any error messages | ||
*/ | ||
Timeout = 2, | ||
errorMessages?: string[]; | ||
/** | ||
* Optional: the time it took | ||
*/ | ||
timeSpentMs?: number; | ||
/** | ||
* Optional: the coverage result. | ||
*/ | ||
coverage?: CoverageCollection; | ||
} | ||
export default TestResult; |
"use strict"; | ||
/** | ||
* Indicates what the result of a test run was. | ||
*/ | ||
var TestResult; | ||
(function (TestResult) { | ||
/** | ||
* The TestRunner was able to complete the run. NOTE: This can still mean that one or more tests failed. | ||
*/ | ||
TestResult[TestResult["Complete"] = 0] = "Complete"; | ||
/** | ||
* The TestRunner was unable to complete the run due to an unexpected error. For example: the code contains a syntax error | ||
*/ | ||
TestResult[TestResult["Error"] = 1] = "Error"; | ||
/** | ||
* The TestRunner was unable to complete the test run fast enough. | ||
*/ | ||
TestResult[TestResult["Timeout"] = 2] = "Timeout"; | ||
})(TestResult || (TestResult = {})); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = TestResult; | ||
//# sourceMappingURL=TestResult.js.map |
@@ -0,8 +1,10 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="es6-promise" /> | ||
import RunResult from './RunResult'; | ||
import RunOptions from './RunOptions'; | ||
import { EventEmitter } from 'events'; | ||
/** | ||
* Represents a TestRunner which can execute tests, resulting in a RunResult. | ||
*/ | ||
interface TestRunner { | ||
interface TestRunner extends EventEmitter { | ||
/** | ||
@@ -9,0 +11,0 @@ * Optional. When implemented, will be called before runs are done on this test runner. |
export * from './src/test_runner/Coverage'; | ||
export { default as TestResult } from './src/test_runner/TestResult'; | ||
export { default as TestRunner } from './src/test_runner/TestRunner'; | ||
export { default as TestState } from './src/test_runner/TestState'; | ||
export { default as RunnerOptions } from './src/test_runner/RunnerOptions'; | ||
export { default as RunResult } from './src/test_runner/RunResult'; | ||
export { default as RunOptions } from './src/test_runner/RunOptions'; | ||
export { default as RunState } from './src/test_runner/RunState'; | ||
export { default as TestRunnerFactory } from './src/test_runner/TestRunnerFactory'; |
"use strict"; | ||
var TestResult_1 = require('./src/test_runner/TestResult'); | ||
exports.TestResult = TestResult_1.default; | ||
var TestState_1 = require('./src/test_runner/TestState'); | ||
exports.TestState = TestState_1.default; | ||
var RunState_1 = require('./src/test_runner/RunState'); | ||
exports.RunState = RunState_1.default; | ||
var TestRunnerFactory_1 = require('./src/test_runner/TestRunnerFactory'); | ||
exports.TestRunnerFactory = TestRunnerFactory_1.default; | ||
//# sourceMappingURL=test_runner.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
106246
173
1635