Comparing version 0.29.1 to 0.29.2
@@ -6,2 +6,10 @@ # Change Log | ||
<a name="0.29.2"></a> | ||
## [0.29.2](https://github.com/stryker-mutator/stryker/compare/stryker@0.29.1...stryker@0.29.2) (2018-09-14) | ||
**Note:** Version bump only for package stryker | ||
<a name="0.29.1"></a> | ||
@@ -8,0 +16,0 @@ ## [0.29.1](https://github.com/stryker-mutator/stryker/compare/stryker@0.29.0...stryker@0.29.1) (2018-08-28) |
{ | ||
"name": "stryker", | ||
"version": "0.29.1", | ||
"version": "0.29.2", | ||
"description": "The extendable JavaScript mutation testing framework", | ||
@@ -57,3 +57,3 @@ "main": "src/Stryker.js", | ||
"chalk": "~2.4.1", | ||
"commander": "~2.17.1", | ||
"commander": "~2.18.0", | ||
"escodegen": "~1.8.0", | ||
@@ -64,3 +64,3 @@ "esprima": "~2.7.0", | ||
"inquirer": "~6.2.0", | ||
"istanbul-lib-instrument": "~1.10.1", | ||
"istanbul-lib-instrument": "~2.3.2", | ||
"lodash": "~4.17.4", | ||
@@ -73,3 +73,3 @@ "log4js": "~3.0.0", | ||
"rimraf": "~2.6.1", | ||
"rxjs": "~6.2.2", | ||
"rxjs": "~6.3.0", | ||
"source-map": "~0.6.1", | ||
@@ -88,3 +88,3 @@ "surrial": "~0.1.3", | ||
"@types/progress": "~2.0.1", | ||
"stryker-api": "^0.21.0" | ||
"stryker-api": "^0.21.1" | ||
}, | ||
@@ -91,0 +91,0 @@ "peerDependencies": { |
import LoggingClientContext from '../logging/LoggingClientContext'; | ||
interface Func<TS extends any[], R> { | ||
(...args: TS): R; | ||
} | ||
interface PromisifiedFunc<TS extends any[], R> { | ||
(...args: TS): Promise<R>; | ||
} | ||
declare type Func<TS extends any[], R> = (...args: TS) => R; | ||
declare type PromisifiedFunc<TS extends any[], R> = (...args: TS) => Promise<R>; | ||
interface Constructor<T, TS extends any[]> { | ||
@@ -16,14 +12,14 @@ new (...args: TS): T; | ||
readonly proxy: Promisified<T>; | ||
private worker; | ||
private initTask; | ||
private readonly worker; | ||
private readonly initTask; | ||
private disposeTask; | ||
private currentError; | ||
private workerTasks; | ||
private log; | ||
private stdoutAndStderrBuilder; | ||
private readonly workerTasks; | ||
private readonly log; | ||
private readonly stdoutAndStderrBuilder; | ||
private isDisposed; | ||
private constructor(); | ||
/** | ||
* Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process | ||
*/ | ||
* @description Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process | ||
*/ | ||
static create<T, TS extends any[]>(requirePath: string, loggingContext: LoggingClientContext, plugins: string[], workingDirectory: string, _: Constructor<T, TS>, ...constructorArgs: TS): ChildProcessProxy<T>; | ||
@@ -30,0 +26,0 @@ private send; |
@@ -26,2 +26,3 @@ "use strict"; | ||
this.send({ | ||
constructorArgs: constructorParams, | ||
kind: messageProtocol_1.WorkerMessageKind.Init, | ||
@@ -31,3 +32,2 @@ loggingContext: loggingContext, | ||
requirePath: requirePath, | ||
constructorArgs: constructorParams, | ||
workingDirectory: workingDirectory | ||
@@ -45,4 +45,4 @@ }); | ||
/** | ||
* Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process | ||
*/ | ||
* @description Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process | ||
*/ | ||
ChildProcessProxy.create = function (requirePath, loggingContext, plugins, workingDirectory, _) { | ||
@@ -88,6 +88,6 @@ var constructorArgs = []; | ||
_this.send({ | ||
args: args, | ||
correlationId: correlationId_1, | ||
kind: messageProtocol_1.WorkerMessageKind.Call, | ||
correlationId: correlationId_1, | ||
methodName: methodName, | ||
args: args | ||
methodName: methodName | ||
}); | ||
@@ -94,0 +94,0 @@ }); |
@@ -44,4 +44,4 @@ "use strict"; | ||
_this.send({ | ||
correlationId: message.correlationId, | ||
kind: messageProtocol_1.ParentMessageKind.Result, | ||
correlationId: message.correlationId, | ||
result: result | ||
@@ -51,5 +51,5 @@ }); | ||
_this.send({ | ||
kind: messageProtocol_1.ParentMessageKind.Rejection, | ||
correlationId: message.correlationId, | ||
error: objectUtils_1.errorToString(error), | ||
correlationId: message.correlationId | ||
kind: messageProtocol_1.ParentMessageKind.Rejection | ||
}); | ||
@@ -56,0 +56,0 @@ }); |
@@ -16,5 +16,5 @@ "use strict"; | ||
})(ParentMessageKind = exports.ParentMessageKind || (exports.ParentMessageKind = {})); | ||
// Make this an unlikely command line argument | ||
// Make this an unlikely command line argument | ||
// (prevents incidental start of child process) | ||
exports.autoStart = 'childProcessAutoStart12937129s7d'; | ||
//# sourceMappingURL=messageProtocol.js.map |
@@ -5,3 +5,3 @@ import { Config } from 'stryker-api/config'; | ||
export default class ConfigReader { | ||
private cliOptions; | ||
private readonly cliOptions; | ||
private readonly log; | ||
@@ -8,0 +8,0 @@ constructor(cliOptions: StrykerOptions); |
import { TestFramework } from 'stryker-api/test_framework'; | ||
import { Config } from 'stryker-api/config'; | ||
export default class ConfigValidator { | ||
private strykerConfig; | ||
private testFramework; | ||
private readonly strykerConfig; | ||
private readonly testFramework; | ||
private isValid; | ||
@@ -7,0 +7,0 @@ private readonly log; |
@@ -97,3 +97,3 @@ "use strict"; | ||
ConfigValidator.prototype.validateIsNumber = function (fieldName, value) { | ||
if (typeof value !== 'number') { | ||
if (typeof value !== 'number' || isNaN(value)) { | ||
this.invalidate("Value \"" + value + "\" is invalid for `" + fieldName + "`. Expected a number"); | ||
@@ -100,0 +100,0 @@ } |
import { RestClient } from 'typed-rest-client/RestClient'; | ||
import PromptOption from './PromptOption'; | ||
export default class NpmClient { | ||
private searchClient; | ||
private packageClient; | ||
private readonly searchClient; | ||
private readonly packageClient; | ||
private readonly log; | ||
@@ -7,0 +7,0 @@ constructor(searchClient?: RestClient, packageClient?: RestClient); |
@@ -76,4 +76,4 @@ "use strict"; | ||
var result = { | ||
total: 0, | ||
results: [] | ||
results: [], | ||
total: 0 | ||
}; | ||
@@ -80,0 +80,0 @@ return result; |
import { StrykerOptions } from 'stryker-api/core'; | ||
import PromptOption from './PromptOption'; | ||
export default class StrykerConfigWriter { | ||
private out; | ||
private readonly out; | ||
private readonly log; | ||
@@ -9,5 +9,5 @@ constructor(out: (output: string) => void); | ||
/** | ||
* Create stryker.conf.js based on the chosen framework and test runner | ||
* @function | ||
*/ | ||
* Create stryker.conf.js based on the chosen framework and test runner | ||
* @function | ||
*/ | ||
write(selectedTestRunner: null | PromptOption, selectedTestFramework: null | PromptOption, selectedMutator: null | PromptOption, selectedTranspilers: null | PromptOption[], selectedReporters: PromptOption[], selectedPackageManager: PromptOption, additionalPiecesOfConfig: Partial<StrykerOptions>[]): Promise<void>; | ||
@@ -14,0 +14,0 @@ private configureTestFramework; |
@@ -22,5 +22,5 @@ "use strict"; | ||
/** | ||
* Create stryker.conf.js based on the chosen framework and test runner | ||
* @function | ||
*/ | ||
* Create stryker.conf.js based on the chosen framework and test runner | ||
* @function | ||
*/ | ||
StrykerConfigWriter.prototype.write = function (selectedTestRunner, selectedTestFramework, selectedMutator, selectedTranspilers, selectedReporters, selectedPackageManager, additionalPiecesOfConfig) { | ||
@@ -31,7 +31,7 @@ return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
configObject = { | ||
testRunner: selectedTestRunner ? selectedTestRunner.name : '', | ||
mutator: selectedMutator ? selectedMutator.name : '', | ||
transpilers: selectedTranspilers ? selectedTranspilers.map(function (t) { return t.name; }) : [], | ||
packageManager: selectedPackageManager.name, | ||
reporters: selectedReporters.map(function (rep) { return rep.name; }), | ||
packageManager: selectedPackageManager.name | ||
testRunner: selectedTestRunner ? selectedTestRunner.name : '', | ||
transpilers: selectedTranspilers ? selectedTranspilers.map(function (t) { return t.name; }) : [] | ||
}; | ||
@@ -38,0 +38,0 @@ this.configureTestFramework(configObject, selectedTestFramework); |
import NpmClient from './NpmClient'; | ||
export default class StrykerInitializer { | ||
private out; | ||
private client; | ||
private readonly out; | ||
private readonly client; | ||
private readonly log; | ||
private inquirer; | ||
private readonly inquirer; | ||
constructor(out?: (message?: any, ...optionalParams: any[]) => void, client?: NpmClient); | ||
@@ -14,5 +14,5 @@ /** | ||
/** | ||
* The typed rest client works only with the specific HTTP_PROXY and HTTPS_PROXY env settings. | ||
* Let's make sure they are available. | ||
*/ | ||
* The typed rest client works only with the specific HTTP_PROXY and HTTPS_PROXY env settings. | ||
* Let's make sure they are available. | ||
*/ | ||
private patchProxies; | ||
@@ -27,7 +27,7 @@ private selectTestRunner; | ||
/** | ||
* Install the npm packages | ||
* @function | ||
*/ | ||
* Install the npm packages | ||
* @function | ||
*/ | ||
private installNpmDependencies; | ||
private fetchAdditionalConfig; | ||
} |
@@ -81,5 +81,5 @@ "use strict"; | ||
/** | ||
* The typed rest client works only with the specific HTTP_PROXY and HTTPS_PROXY env settings. | ||
* Let's make sure they are available. | ||
*/ | ||
* The typed rest client works only with the specific HTTP_PROXY and HTTPS_PROXY env settings. | ||
* Let's make sure they are available. | ||
*/ | ||
StrykerInitializer.prototype.patchProxies = function () { | ||
@@ -102,9 +102,11 @@ var copyEnvVariable = function (from, to) { | ||
testRunnerOptions = _a.sent(); | ||
if (!testRunnerOptions.length) return [3 /*break*/, 3]; | ||
this.log.debug("Found test runners: " + JSON.stringify(testRunnerOptions)); | ||
return [4 /*yield*/, this.inquirer.promptTestRunners(testRunnerOptions)]; | ||
case 2: return [2 /*return*/, _a.sent()]; | ||
case 3: | ||
this.out('Unable to select a test runner. You will need to configure it manually.'); | ||
return [2 /*return*/, null]; | ||
if (testRunnerOptions.length) { | ||
this.log.debug("Found test runners: " + JSON.stringify(testRunnerOptions)); | ||
return [2 /*return*/, this.inquirer.promptTestRunners(testRunnerOptions)]; | ||
} | ||
else { | ||
this.out('Unable to select a test runner. You will need to configure it manually.'); | ||
return [2 /*return*/, null]; | ||
} | ||
return [2 /*return*/]; | ||
} | ||
@@ -178,9 +180,11 @@ }); | ||
mutatorOptions = _a.sent(); | ||
if (!mutatorOptions.length) return [3 /*break*/, 3]; | ||
this.log.debug("Found mutators: " + JSON.stringify(mutatorOptions)); | ||
return [4 /*yield*/, this.inquirer.promptMutator(mutatorOptions)]; | ||
case 2: return [2 /*return*/, _a.sent()]; | ||
case 3: | ||
this.out('Unable to select a mutator. You will need to configure it manually.'); | ||
return [2 /*return*/, null]; | ||
if (mutatorOptions.length) { | ||
this.log.debug("Found mutators: " + JSON.stringify(mutatorOptions)); | ||
return [2 /*return*/, this.inquirer.promptMutator(mutatorOptions)]; | ||
} | ||
else { | ||
this.out('Unable to select a mutator. You will need to configure it manually.'); | ||
return [2 /*return*/, null]; | ||
} | ||
return [2 /*return*/]; | ||
} | ||
@@ -198,9 +202,11 @@ }); | ||
options = _a.sent(); | ||
if (!options.length) return [3 /*break*/, 3]; | ||
this.log.debug("Found transpilers: " + JSON.stringify(options)); | ||
return [4 /*yield*/, this.inquirer.promptTranspilers(options)]; | ||
case 2: return [2 /*return*/, _a.sent()]; | ||
case 3: | ||
this.out('Unable to select transpilers. You will need to configure it manually, if you want to use any.'); | ||
return [2 /*return*/, null]; | ||
if (options.length) { | ||
this.log.debug("Found transpilers: " + JSON.stringify(options)); | ||
return [2 /*return*/, this.inquirer.promptTranspilers(options)]; | ||
} | ||
else { | ||
this.out('Unable to select transpilers. You will need to configure it manually, if you want to use any.'); | ||
return [2 /*return*/, null]; | ||
} | ||
return [2 /*return*/]; | ||
} | ||
@@ -231,5 +237,5 @@ }); | ||
/** | ||
* Install the npm packages | ||
* @function | ||
*/ | ||
* Install the npm packages | ||
* @function | ||
*/ | ||
StrykerInitializer.prototype.installNpmDependencies = function (dependencies, selectedOption) { | ||
@@ -236,0 +242,0 @@ if (dependencies.length === 0) { |
@@ -19,7 +19,7 @@ "use strict"; | ||
return [4 /*yield*/, inquirer.prompt({ | ||
type: 'list', | ||
choices: choices, | ||
default: 'Mocha', | ||
message: 'Which test runner do you want to use? If your test runner isn\'t listed here, you can choose "command" (it uses your `npm test` command, but will come with a big performance penalty)', | ||
name: 'testRunner', | ||
message: 'Which test runner do you want to use? If your test runner isn\'t listed here, you can choose "command" (it uses your `npm test` command, but will come with a big performance penalty)', | ||
choices: choices, | ||
default: 'Mocha' | ||
type: 'list' | ||
})]; | ||
@@ -39,6 +39,6 @@ case 1: | ||
case 0: return [4 /*yield*/, inquirer.prompt({ | ||
type: 'list', | ||
choices: options.map(function (_) { return _.name; }), | ||
message: 'Which test framework do you want to use?', | ||
name: 'testFramework', | ||
message: 'Which test framework do you want to use?', | ||
choices: options.map(function (_) { return _.name; }), | ||
type: 'list' | ||
})]; | ||
@@ -58,6 +58,6 @@ case 1: | ||
case 0: return [4 /*yield*/, inquirer.prompt({ | ||
type: 'list', | ||
choices: options.map(function (_) { return _.name; }), | ||
message: 'What kind of code do you want to mutate?', | ||
name: 'mutator', | ||
message: 'What kind of code do you want to mutate?', | ||
choices: options.map(function (_) { return _.name; }) | ||
type: 'list' | ||
})]; | ||
@@ -77,6 +77,6 @@ case 1: | ||
case 0: return [4 /*yield*/, inquirer.prompt({ | ||
type: 'checkbox', | ||
choices: options.map(function (_) { return _.name; }), | ||
message: '[optional] What kind transformations should be applied to your code?', | ||
name: 'transpilers', | ||
message: '[optional] What kind transformations should be applied to your code?', | ||
choices: options.map(function (_) { return _.name; }) | ||
type: 'checkbox' | ||
})]; | ||
@@ -96,7 +96,7 @@ case 1: | ||
case 0: return [4 /*yield*/, inquirer.prompt({ | ||
type: 'checkbox', | ||
choices: options.map(function (_) { return _.name; }), | ||
default: ['clear-text', 'progress'], | ||
message: 'Which reporter(s) do you want to use?', | ||
name: 'reporters', | ||
message: 'Which reporter(s) do you want to use?', | ||
choices: options.map(function (_) { return _.name; }), | ||
default: ['clear-text', 'progress'] | ||
type: 'checkbox' | ||
})]; | ||
@@ -116,11 +116,11 @@ case 1: | ||
case 0: return [4 /*yield*/, inquirer.prompt({ | ||
type: 'list', | ||
choices: options.map(function (_) { return _.name; }), | ||
default: ['npm'], | ||
message: 'Which package manager do you want to use?', | ||
name: 'packageManager', | ||
message: 'Which package manager do you want to use?', | ||
choices: options.map(function (_) { return _.name; }), | ||
default: ['npm'] | ||
type: 'list' | ||
})]; | ||
case 1: | ||
answers = _a.sent(); | ||
return [2 /*return*/, options.filter(function (_) { return _.name === answers['packageManager']; })[0]]; | ||
return [2 /*return*/, options.filter(function (_) { return _.name === answers.packageManager; })[0]]; | ||
} | ||
@@ -127,0 +127,0 @@ }); |
import StrictReporter from '../reporters/StrictReporter'; | ||
import InputFileCollection from './InputFileCollection'; | ||
export default class InputFileResolver { | ||
private reporter; | ||
private readonly reporter; | ||
private readonly log; | ||
private fileResolver; | ||
private mutateResolver; | ||
private readonly fileResolver; | ||
private readonly mutateResolver; | ||
constructor(mutate: string[], files: string[] | undefined, reporter: StrictReporter); | ||
@@ -9,0 +9,0 @@ resolve(): Promise<InputFileCollection>; |
@@ -15,4 +15,4 @@ "use strict"; | ||
return { | ||
path: file.name, | ||
content: file.textContent | ||
content: file.textContent, | ||
path: file.name | ||
}; | ||
@@ -123,3 +123,3 @@ } | ||
if (inputFileDescriptorObjects.length) { | ||
new PatternResolver('').log.warn(objectUtils_1.normalizeWhiteSpaces("\n DEPRECATED: Using the `InputFileDescriptor` syntax to \n select files is no longer supported. We'll assume: " + JSON.stringify(inputFileDescriptorObjects) + " can be migrated \n to " + JSON.stringify(inputFileDescriptorObjects.map(function (_) { return _.pattern; })) + " for this mutation run.\n Please move any files to mutate into the `mutate` array (top level stryker option).\n You can fix this warning in 2 ways:\n 1) If your project is under git version control, you can remove the \"files\" patterns all together. \n Stryker can figure it out for you.\n 2) If your project is not under git version control or you need ignored files in your sandbox, you can replace the \n `InputFileDescriptor` syntax with strings (as done for this test run).")); | ||
new PatternResolver('').log.warn(objectUtils_1.normalizeWhiteSpaces("\n DEPRECATED: Using the `InputFileDescriptor` syntax to\n select files is no longer supported. We'll assume: " + JSON.stringify(inputFileDescriptorObjects) + " can be migrated\n to " + JSON.stringify(inputFileDescriptorObjects.map(function (_) { return _.pattern; })) + " for this mutation run.\n Please move any files to mutate into the `mutate` array (top level stryker option).\n You can fix this warning in 2 ways:\n 1) If your project is under git version control, you can remove the \"files\" patterns all together.\n Stryker can figure it out for you.\n 2) If your project is not under git version control or you need ignored files in your sandbox, you can replace the\n `InputFileDescriptor` syntax with strings (as done for this test run).")); | ||
} | ||
@@ -126,0 +126,0 @@ return globExpressions; |
@@ -20,8 +20,8 @@ "use strict"; | ||
color: { | ||
type: 'pattern', | ||
pattern: '%[%r (%z) %p %c%] %m' | ||
pattern: '%[%r (%z) %p %c%] %m', | ||
type: 'pattern' | ||
}, | ||
noColor: { | ||
type: 'pattern', | ||
pattern: '%r (%z) %p %c %m' | ||
pattern: '%r (%z) %p %c %m', | ||
type: 'pattern' | ||
} | ||
@@ -99,6 +99,6 @@ }; | ||
multiProcessAppender = { | ||
type: 'multiprocess', | ||
appender: AppenderName.All, | ||
loggerPort: loggerPort, | ||
mode: 'master', | ||
appender: AppenderName.All, | ||
loggerPort: loggerPort | ||
type: 'multiprocess' | ||
}; | ||
@@ -109,4 +109,4 @@ appenders[AppenderName.Server] = multiProcessAppender; | ||
context = { | ||
port: loggerPort, | ||
level: defaultLogLevel | ||
level: defaultLogLevel, | ||
port: loggerPort | ||
}; | ||
@@ -113,0 +113,0 @@ return [2 /*return*/, context]; |
import { LoggingEvent } from 'log4js'; | ||
export interface RuntimeAppender { | ||
(loggingEvent: LoggingEvent): void; | ||
} | ||
export declare type RuntimeAppender = (loggingEvent: LoggingEvent) => void; | ||
export declare class MultiAppender { | ||
private appenders; | ||
private readonly appenders; | ||
constructor(appenders: RuntimeAppender[]); | ||
@@ -8,0 +6,0 @@ append(loggingEvent: LoggingEvent): void; |
@@ -9,9 +9,9 @@ import { RunResult } from 'stryker-api/test_runner'; | ||
export default class MutantTestMatcher { | ||
private mutants; | ||
private filesToMutate; | ||
private initialRunResult; | ||
private sourceMapper; | ||
private coveragePerFile; | ||
private options; | ||
private reporter; | ||
private readonly mutants; | ||
private readonly filesToMutate; | ||
private readonly initialRunResult; | ||
private readonly sourceMapper; | ||
private readonly coveragePerFile; | ||
private readonly options; | ||
private readonly reporter; | ||
private readonly log; | ||
@@ -18,0 +18,0 @@ constructor(mutants: ReadonlyArray<Mutant>, filesToMutate: ReadonlyArray<File>, initialRunResult: RunResult, sourceMapper: SourceMapper, coveragePerFile: CoverageMapsByFile, options: StrykerOptions, reporter: StrictReporter); |
@@ -129,8 +129,8 @@ "use strict"; | ||
var matchedMutant = _.cloneDeep({ | ||
fileName: testableMutant.mutant.fileName, | ||
id: testableMutant.id, | ||
mutatorName: testableMutant.mutant.mutatorName, | ||
replacement: testableMutant.mutant.replacement, | ||
scopedTestIds: testableMutant.selectedTests.map(function (testSelection) { return testSelection.id; }), | ||
timeSpentScopedTests: testableMutant.timeSpentScopedTests, | ||
fileName: testableMutant.mutant.fileName, | ||
replacement: testableMutant.mutant.replacement | ||
}); | ||
@@ -143,4 +143,4 @@ return Object.freeze(matchedMutant); | ||
return { | ||
kind: StatementIndexKind.statement, | ||
index: statementIndex | ||
index: statementIndex, | ||
kind: StatementIndexKind.statement | ||
}; | ||
@@ -152,4 +152,4 @@ } | ||
return { | ||
kind: StatementIndexKind.function, | ||
index: functionIndex | ||
index: functionIndex, | ||
kind: StatementIndexKind.function | ||
}; | ||
@@ -156,0 +156,0 @@ } |
@@ -5,3 +5,3 @@ import { File } from 'stryker-api/core'; | ||
export default class MutatorFacade implements Mutator { | ||
private config; | ||
private readonly config; | ||
constructor(config: Config); | ||
@@ -8,0 +8,0 @@ mutate(inputFiles: ReadonlyArray<File>): ReadonlyArray<Mutant>; |
@@ -5,5 +5,5 @@ import NodeMutator from './NodeMutator'; | ||
name: string; | ||
private type; | ||
private operators; | ||
private readonly type; | ||
private readonly operators; | ||
applyMutations(node: IdentifiedNode, copy: <T extends IdentifiedNode>(obj: T, deep?: boolean) => T): IdentifiedNode[]; | ||
} |
@@ -9,15 +9,15 @@ "use strict"; | ||
this.operators = { | ||
'!=': '==', | ||
'!==': '===', | ||
'%': '*', | ||
'*': '/', | ||
'+': '-', | ||
'-': '+', | ||
'*': '/', | ||
'/': '*', | ||
'%': '*', | ||
'<': ['<=', '>='], | ||
'<=': ['<', '>'], | ||
'>': ['>=', '<='], | ||
'>=': ['>', '<'], | ||
'==': '!=', | ||
'!=': '==', | ||
'===': '!==', | ||
'!==': '===' | ||
'>': ['>=', '<='], | ||
'>=': ['>', '<'] | ||
}; | ||
@@ -24,0 +24,0 @@ } |
@@ -8,5 +8,5 @@ import NodeMutator from './NodeMutator'; | ||
name: string; | ||
private type; | ||
private readonly type; | ||
constructor(); | ||
applyMutations(node: IdentifiedNode, copy: <T extends IdentifiedNode>(obj: T, deep?: boolean) => T): void | IdentifiedNode; | ||
} |
@@ -6,3 +6,3 @@ import { Config } from 'stryker-api/config'; | ||
export default class ES5Mutator implements Mutator { | ||
private mutators; | ||
private readonly mutators; | ||
private readonly log; | ||
@@ -9,0 +9,0 @@ constructor(_?: Config, mutators?: NodeMutator[]); |
@@ -5,5 +5,5 @@ import NodeMutator from './NodeMutator'; | ||
name: string; | ||
private type; | ||
private operators; | ||
private readonly type; | ||
private readonly operators; | ||
applyMutations(node: IdentifiedNode, copy: <T extends IdentifiedNode>(obj: T, deep?: boolean) => T): IdentifiedNode[]; | ||
} |
@@ -8,3 +8,3 @@ import NodeMutator from './NodeMutator'; | ||
name: string; | ||
private types; | ||
private readonly types; | ||
constructor(); | ||
@@ -11,0 +11,0 @@ applyMutations(node: IdentifiedNode, copy: <T extends IdentifiedNode>(obj: T, deep?: boolean) => T): IdentifiedNode[] | void; |
@@ -32,5 +32,5 @@ "use strict"; | ||
nodeID: nodeID, | ||
raw: value.toString(), | ||
type: esprima_1.Syntax.Literal, | ||
value: value, | ||
raw: value.toString() | ||
value: value | ||
}; | ||
@@ -37,0 +37,0 @@ }; |
@@ -5,5 +5,5 @@ import NodeMutator from './NodeMutator'; | ||
name: string; | ||
private type; | ||
private operators; | ||
private readonly type; | ||
private readonly operators; | ||
applyMutations(node: IdentifiedNode, copy: <T extends IdentifiedNode>(obj: T, deep?: boolean) => T): IdentifiedNode[]; | ||
} |
@@ -5,5 +5,5 @@ import NodeMutator from './NodeMutator'; | ||
name: string; | ||
private type; | ||
private operators; | ||
private readonly type; | ||
private readonly operators; | ||
applyMutations(node: IdentifiedNode, copy: <T extends IdentifiedNode>(obj: T, deep?: boolean) => T): void | IdentifiedNode; | ||
} |
export default class PluginLoader { | ||
private plugins; | ||
private readonly plugins; | ||
private readonly log; | ||
@@ -4,0 +4,0 @@ constructor(plugins: string[]); |
@@ -16,7 +16,7 @@ import { RunResult } from 'stryker-api/test_runner'; | ||
export default class InitialTestExecutor { | ||
private options; | ||
private inputFiles; | ||
private testFramework; | ||
private timer; | ||
private loggingContext; | ||
private readonly options; | ||
private readonly inputFiles; | ||
private readonly testFramework; | ||
private readonly timer; | ||
private readonly loggingContext; | ||
private readonly log; | ||
@@ -23,0 +23,0 @@ constructor(options: Config, inputFiles: InputFileCollection, testFramework: TestFramework | null, timer: Timer, loggingContext: LoggingClientContext); |
@@ -47,6 +47,6 @@ "use strict"; | ||
return [2 /*return*/, { | ||
coverageMaps: coverageMaps, | ||
overheadTimeMS: timing.overhead, | ||
sourceMapper: sourceMapper, | ||
runResult: runResult, | ||
coverageMaps: coverageMaps | ||
sourceMapper: sourceMapper | ||
}]; | ||
@@ -82,8 +82,4 @@ } | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
transpilerFacade = this.createTranspilerFacade(); | ||
return [4 /*yield*/, transpilerFacade.transpile(this.inputFiles.files)]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
} | ||
transpilerFacade = this.createTranspilerFacade(); | ||
return [2 /*return*/, transpilerFacade.transpile(this.inputFiles.files)]; | ||
}); | ||
@@ -144,4 +140,4 @@ }); | ||
return { | ||
overhead: overheadTimeMS < 0 ? 0 : overheadTimeMS, | ||
net: netTimeMS | ||
net: netTimeMS, | ||
overhead: overheadTimeMS < 0 ? 0 : overheadTimeMS | ||
}; | ||
@@ -148,0 +144,0 @@ }; |
@@ -9,8 +9,8 @@ import { Config } from 'stryker-api/config'; | ||
export default class MutationTestExecutor { | ||
private config; | ||
private inputFiles; | ||
private testFramework; | ||
private reporter; | ||
private overheadTimeMS; | ||
private loggingContext; | ||
private readonly config; | ||
private readonly inputFiles; | ||
private readonly testFramework; | ||
private readonly reporter; | ||
private readonly overheadTimeMS; | ||
private readonly loggingContext; | ||
constructor(config: Config, inputFiles: ReadonlyArray<File>, testFramework: TestFramework | null, reporter: StrictReporter, overheadTimeMS: number, loggingContext: LoggingClientContext); | ||
@@ -17,0 +17,0 @@ run(allMutants: TestableMutant[]): Promise<MutantResult[]>; |
import { StrykerOptions } from 'stryker-api/core'; | ||
import StrictReporter from './reporters/StrictReporter'; | ||
export default class ReporterOrchestrator { | ||
private options; | ||
private readonly options; | ||
private readonly log; | ||
@@ -6,0 +6,0 @@ constructor(options: StrykerOptions); |
@@ -8,3 +8,3 @@ import { Reporter, SourceFile, MutantResult, MatchedMutant, ScoreResult } from 'stryker-api/report'; | ||
export default class BroadcastReporter implements StrictReporter { | ||
private reporters; | ||
private readonly reporters; | ||
private readonly log; | ||
@@ -11,0 +11,0 @@ constructor(reporters: NamedReporter[]); |
@@ -12,3 +12,2 @@ "use strict"; | ||
var _this = this; | ||
if (eventArgs === void 0) { eventArgs = undefined; } | ||
var allPromises = []; | ||
@@ -53,3 +52,3 @@ this.reporters.forEach(function (namedReporter) { | ||
BroadcastReporter.prototype.wrapUp = function () { | ||
return this.broadcast('wrapUp'); | ||
return this.broadcast('wrapUp', undefined); | ||
}; | ||
@@ -56,0 +55,0 @@ BroadcastReporter.prototype.handleError = function (error, methodName, reporterName) { |
@@ -8,7 +8,7 @@ import CircleProvider from './CircleProvider'; | ||
/** Returns whether Stryker is running on a pull request. */ | ||
isPullRequest: () => boolean; | ||
isPullRequest(): boolean; | ||
/** Returns the name of the Git branch of the project on which Stryker is running. */ | ||
determineBranch: () => string; | ||
determineBranch(): string; | ||
/** Returns the name of the GitHub repository of the project on which Stryker is running. */ | ||
determineRepository: () => string; | ||
determineRepository(): string; | ||
} | ||
@@ -15,0 +15,0 @@ /** |
import { Reporter, MutantResult, ScoreResult } from 'stryker-api/report'; | ||
import { Config } from 'stryker-api/config'; | ||
export default class ClearTextReporter implements Reporter { | ||
private options; | ||
private readonly options; | ||
private readonly log; | ||
constructor(options: Config); | ||
private out; | ||
private readonly out; | ||
private writeLine; | ||
@@ -9,0 +9,0 @@ onAllMutantsTested(mutantResults: MutantResult[]): void; |
@@ -75,3 +75,3 @@ "use strict"; | ||
ClearTextReporter.prototype.logExecutedTests = function (result, logImplementation) { | ||
var clearTextReporterConfig = this.options['clearTextReporter']; | ||
var clearTextReporterConfig = this.options.clearTextReporter; | ||
if (result.testsRan && result.testsRan.length > 0) { | ||
@@ -78,0 +78,0 @@ var testsToLog = 3; |
@@ -7,4 +7,4 @@ import { MutationScoreThresholds } from 'stryker-api/core'; | ||
export default class ClearTextScoreTable { | ||
private score; | ||
private columns; | ||
private readonly score; | ||
private readonly columns; | ||
constructor(score: ScoreResult, thresholds: MutationScoreThresholds); | ||
@@ -11,0 +11,0 @@ private drawBorder; |
@@ -9,3 +9,3 @@ import { HttpClient } from 'typed-rest-client/HttpClient'; | ||
export default class DashboardReporterClient { | ||
private dashboardReporterClient; | ||
private readonly dashboardReporterClient; | ||
private readonly log; | ||
@@ -12,0 +12,0 @@ constructor(dashboardReporterClient?: HttpClient); |
@@ -5,3 +5,3 @@ import { Reporter, ScoreResult } from 'stryker-api/report'; | ||
export default class DashboardReporter implements Reporter { | ||
private dashboardReporterClient; | ||
private readonly dashboardReporterClient; | ||
private readonly log; | ||
@@ -8,0 +8,0 @@ private readonly ciProvider; |
@@ -41,5 +41,5 @@ "use strict"; | ||
apiKey: apiKey, | ||
repositorySlug: 'github.com/' + repository, | ||
branch: branch, | ||
mutationScore: mutationScore | ||
mutationScore: mutationScore, | ||
repositorySlug: 'github.com/' + repository | ||
})]; | ||
@@ -46,0 +46,0 @@ case 1: |
import { StrykerOptions } from 'stryker-api/core'; | ||
import { SourceFile, MutantResult, MatchedMutant, Reporter, ScoreResult } from 'stryker-api/report'; | ||
import { SourceFile, MutantResult, MatchedMutant, ScoreResult } from 'stryker-api/report'; | ||
import StrictReporter from './StrictReporter'; | ||
export default class EventRecorderReporter implements StrictReporter { | ||
private options; | ||
private readonly options; | ||
private readonly log; | ||
private allWork; | ||
private createBaseFolderTask; | ||
private readonly allWork; | ||
private readonly createBaseFolderTask; | ||
private _baseFolder; | ||
@@ -15,3 +15,3 @@ private index; | ||
private format; | ||
work(eventName: keyof Reporter, data: any): void; | ||
private work; | ||
onSourceFileRead(file: SourceFile): void; | ||
@@ -18,0 +18,0 @@ onAllSourceFilesRead(files: SourceFile[]): void; |
@@ -20,4 +20,4 @@ "use strict"; | ||
if (!this._baseFolder) { | ||
if (this.options['eventReporter'] && this.options['eventReporter']['baseDir']) { | ||
this._baseFolder = this.options['eventReporter']['baseDir']; | ||
if (this.options.eventReporter && this.options.eventReporter.baseDir) { | ||
this._baseFolder = this.options.eventReporter.baseDir; | ||
this.log.debug("Using configured output folder " + this._baseFolder); | ||
@@ -24,0 +24,0 @@ } |
@@ -15,7 +15,7 @@ "use strict"; | ||
this.progressBar = new ProgressBar_1.default(progressBarContent, { | ||
width: 50, | ||
complete: '=', | ||
incomplete: ' ', | ||
stream: process.stdout, | ||
total: this.progress.total | ||
total: this.progress.total, | ||
width: 50 | ||
}); | ||
@@ -22,0 +22,0 @@ }; |
@@ -8,12 +8,12 @@ import { Config } from 'stryker-api/config'; | ||
export default class Sandbox { | ||
private options; | ||
private index; | ||
private testFramework; | ||
private timeOverheadMS; | ||
private loggingContext; | ||
private readonly options; | ||
private readonly index; | ||
private readonly testFramework; | ||
private readonly timeOverheadMS; | ||
private readonly loggingContext; | ||
private readonly log; | ||
private testRunner; | ||
private fileMap; | ||
private files; | ||
private workingDirectory; | ||
private readonly files; | ||
private readonly workingDirectory; | ||
private constructor(); | ||
@@ -20,0 +20,0 @@ private initialize; |
@@ -106,3 +106,3 @@ "use strict"; | ||
if (error.code === 'EEXIST') { | ||
_this.log.warn(objectUtils_1.normalizeWhiteSpaces("Could not symlink \"" + nodeModules_1 + "\" in sandbox directory, \n it is already created in the sandbox. Please remove the node_modules from your sandbox files. \n Alternatively, set `symlinkNodeModules` to `false` to disable this warning.")); | ||
_this.log.warn(objectUtils_1.normalizeWhiteSpaces("Could not symlink \"" + nodeModules_1 + "\" in sandbox directory,\n it is already created in the sandbox. Please remove the node_modules from your sandbox files.\n Alternatively, set `symlinkNodeModules` to `false` to disable this warning.")); | ||
} | ||
@@ -136,4 +136,4 @@ else { | ||
fileNames: Object.keys(this.fileMap).map(function (sourceFileName) { return _this.fileMap[sourceFileName]; }), | ||
port: this.options.port + this.index, | ||
strykerOptions: this.options, | ||
port: this.options.port + this.index | ||
}; | ||
@@ -140,0 +140,0 @@ this.log.debug("Creating test runner %s using settings {port: %s}", this.index, settings.port); |
@@ -8,7 +8,7 @@ import { Observable } from 'rxjs'; | ||
export default class SandboxPool { | ||
private options; | ||
private testFramework; | ||
private initialFiles; | ||
private overheadTimeMS; | ||
private loggingContext; | ||
private readonly options; | ||
private readonly testFramework; | ||
private readonly initialFiles; | ||
private readonly overheadTimeMS; | ||
private readonly loggingContext; | ||
private readonly log; | ||
@@ -15,0 +15,0 @@ private readonly sandboxes; |
@@ -37,5 +37,6 @@ "use strict"; | ||
return this.copy(scoreResult, { | ||
name: path.dirname(scoreResult.name), childResults: [ | ||
childResults: [ | ||
this.copy(scoreResult, { name: path.basename(scoreResult.name) }) | ||
] | ||
], | ||
name: path.dirname(scoreResult.name) | ||
}); | ||
@@ -59,5 +60,5 @@ } | ||
return { | ||
childResults: childResults, | ||
name: name, | ||
path: path.join(basePath, name), | ||
childResults: childResults, | ||
representsFile: childResults.length === 0 && results.length > 0 | ||
@@ -123,15 +124,15 @@ }; | ||
killed: killed, | ||
survived: survived, | ||
mutationScore: mutationScore, | ||
mutationScoreBasedOnCoveredCode: mutationScoreBasedOnCoveredCode, | ||
noCoverage: noCoverage, | ||
runtimeErrors: runtimeErrors, | ||
transpileErrors: transpileErrors, | ||
survived: survived, | ||
timedOut: timedOut, | ||
totalCovered: totalCovered, | ||
totalDetected: totalDetected, | ||
totalInvalid: totalInvalid, | ||
totalMutants: totalMutants, | ||
totalUndetected: totalUndetected, | ||
totalCovered: totalCovered, | ||
totalValid: totalValid, | ||
totalInvalid: totalInvalid, | ||
totalMutants: totalMutants, | ||
mutationScore: mutationScore, | ||
mutationScoreBasedOnCoveredCode: mutationScoreBasedOnCoveredCode | ||
transpileErrors: transpileErrors | ||
}; | ||
@@ -138,0 +139,0 @@ }; |
@@ -5,3 +5,3 @@ import { File, Range, Location, Position } from 'stryker-api/core'; | ||
file: File; | ||
private lineStarts; | ||
private readonly lineStarts; | ||
constructor(file: File); | ||
@@ -13,10 +13,10 @@ readonly name: string; | ||
/** | ||
* Performs a binary search, finding the index at which 'value' occurs in 'array'. | ||
* If no such index is found, returns the 2's-complement of first index at which | ||
* number[index] exceeds number. | ||
* @param array A sorted array whose first element must be no larger than number | ||
* @param number The value to be searched for in the array. | ||
*/ | ||
* Performs a binary search, finding the index at which 'value' occurs in 'array'. | ||
* If no such index is found, returns the 2's-complement of first index at which | ||
* number[index] exceeds number. | ||
* @param array A sorted array whose first element must be no larger than number | ||
* @param number The value to be searched for in the array. | ||
*/ | ||
private binarySearch; | ||
computeLineStarts(): number[]; | ||
private computeLineStarts; | ||
} |
@@ -41,4 +41,4 @@ "use strict"; | ||
return { | ||
start: this.getPosition(range[0]), | ||
end: this.getPosition(range[1]) | ||
end: this.getPosition(range[1]), | ||
start: this.getPosition(range[0]) | ||
}; | ||
@@ -59,13 +59,13 @@ }; | ||
return { | ||
line: lineNumber, | ||
column: pos - this.lineStarts[lineNumber] | ||
column: pos - this.lineStarts[lineNumber], | ||
line: lineNumber | ||
}; | ||
}; | ||
/** | ||
* Performs a binary search, finding the index at which 'value' occurs in 'array'. | ||
* If no such index is found, returns the 2's-complement of first index at which | ||
* number[index] exceeds number. | ||
* @param array A sorted array whose first element must be no larger than number | ||
* @param number The value to be searched for in the array. | ||
*/ | ||
* Performs a binary search, finding the index at which 'value' occurs in 'array'. | ||
* If no such index is found, returns the 2's-complement of first index at which | ||
* number[index] exceeds number. | ||
* @param array A sorted array whose first element must be no larger than number | ||
* @param number The value to be searched for in the array. | ||
*/ | ||
SourceFile.prototype.binarySearch = function (position, offset) { | ||
@@ -72,0 +72,0 @@ if (offset === void 0) { offset = 0; } |
@@ -6,5 +6,5 @@ import { Config } from 'stryker-api/config'; | ||
config: Config; | ||
private timer; | ||
private reporter; | ||
private testFramework; | ||
private readonly timer; | ||
private readonly reporter; | ||
private readonly testFramework; | ||
private readonly log; | ||
@@ -11,0 +11,0 @@ /** |
export default class StrykerCli { | ||
private argv; | ||
private readonly argv; | ||
private command; | ||
@@ -4,0 +4,0 @@ private strykerConfig; |
@@ -45,11 +45,11 @@ "use strict"; | ||
.parse(this.argv); | ||
LogConfigurator_1.default.configureMainProcess(program['logLevel']); | ||
LogConfigurator_1.default.configureMainProcess(program.logLevel); | ||
var log = logging_1.getLogger(StrykerCli.name); | ||
// Cleanup commander state | ||
delete program['options']; | ||
delete program['rawArgs']; | ||
delete program.options; | ||
delete program.rawArgs; | ||
delete program.args; | ||
delete program.Command; | ||
delete program.Option; | ||
delete program['commands']; | ||
delete program.commands; | ||
for (var i in program) { | ||
@@ -61,3 +61,3 @@ if (i.charAt(0) === '_') { | ||
if (this.strykerConfig) { | ||
program['configFile'] = this.strykerConfig; | ||
program.configFile = this.strykerConfig; | ||
} | ||
@@ -64,0 +64,0 @@ var commands = { |
@@ -30,3 +30,3 @@ "use strict"; | ||
this.worker.proxy.dispose().catch(function (error) { | ||
// It's OK if the child process is already down. | ||
// It's OK if the child process is already down. | ||
if (!(error instanceof ChildProcessCrashedError_1.default)) { | ||
@@ -33,0 +33,0 @@ throw error; |
import { TestRunner, RunnerOptions, RunOptions } from 'stryker-api/test_runner'; | ||
/** | ||
* | ||
*/ | ||
export default class ChildProcessTestRunnerWorker implements TestRunner { | ||
private underlyingTestRunner; | ||
private readonly underlyingTestRunner; | ||
constructor(realTestRunnerName: string, options: RunnerOptions); | ||
@@ -8,0 +5,0 @@ init(): Promise<void>; |
@@ -6,5 +6,2 @@ "use strict"; | ||
var objectUtils_1 = require("../utils/objectUtils"); | ||
/** | ||
* | ||
*/ | ||
var ChildProcessTestRunnerWorker = /** @class */ (function () { | ||
@@ -11,0 +8,0 @@ function ChildProcessTestRunnerWorker(realTestRunnerName, options) { |
@@ -12,3 +12,3 @@ import { TestRunner, RunResult, RunnerOptions } from 'stryker-api/test_runner'; | ||
export default class CommandTestRunner implements TestRunner { | ||
private workingDir; | ||
private readonly workingDir; | ||
/** | ||
@@ -15,0 +15,0 @@ * "command" |
@@ -95,6 +95,6 @@ "use strict"; | ||
tests: [{ | ||
failureMessages: [output.map(function (buf) { return buf.toString(); }).join(os.EOL)], | ||
name: 'All tests', | ||
status: test_runner_1.TestStatus.Failed, | ||
timeSpentMs: duration, | ||
failureMessages: [output.map(function (buf) { return buf.toString(); }).join(os.EOL)] | ||
timeSpentMs: duration | ||
}] | ||
@@ -101,0 +101,0 @@ }; |
@@ -7,5 +7,5 @@ import { RunOptions, RunResult } from 'stryker-api/test_runner'; | ||
export default class RetryDecorator extends TestRunnerDecorator { | ||
log: import("stryker-api/src/logging/Logger").default; | ||
private readonly log; | ||
run(options: RunOptions, attemptsLeft?: number, lastError?: Error): Promise<RunResult>; | ||
private recover; | ||
} |
import { TestRunner, RunOptions, RunResult } from 'stryker-api/test_runner'; | ||
export default class TestRunnerDecorator implements TestRunner { | ||
private testRunnerProducer; | ||
private readonly testRunnerProducer; | ||
protected innerRunner: TestRunner; | ||
constructor(testRunnerProducer: () => TestRunner); | ||
init(): Promise<any>; | ||
init(): Promise<void>; | ||
protected createInnerRunner(): void; | ||
@@ -8,0 +8,0 @@ run(options: RunOptions): Promise<RunResult>; |
@@ -16,3 +16,3 @@ import { Location } from 'stryker-api/core'; | ||
sourceFile: SourceFile; | ||
private _selectedTests; | ||
private readonly _selectedTests; | ||
specsRan: string[]; | ||
@@ -19,0 +19,0 @@ private _timeSpentScopedTests; |
@@ -115,3 +115,4 @@ "use strict"; | ||
TestableMutant.prototype.getMutationLineIndexes = function () { | ||
var startIndexLines = this.mutant.range[0], endIndexLines = this.mutant.range[1]; | ||
var startIndexLines = this.mutant.range[0]; | ||
var endIndexLines = this.mutant.range[1]; | ||
while (startIndexLines > 0 && !SourceFile_1.isLineBreak(this.originalCode.charCodeAt(startIndexLines - 1))) { | ||
@@ -128,11 +129,11 @@ startIndexLines--; | ||
id: this.id, | ||
location: this.location, | ||
mutatedLines: this.mutatedLines, | ||
mutatorName: this.mutatorName, | ||
originalLines: this.originalLines, | ||
range: this.range, | ||
replacement: this.replacement, | ||
sourceFilePath: this.fileName, | ||
mutatorName: this.mutatorName, | ||
status: status, | ||
replacement: this.replacement, | ||
originalLines: this.originalLines, | ||
mutatedLines: this.mutatedLines, | ||
testsRan: testsRan, | ||
location: this.location, | ||
range: this.range | ||
testsRan: testsRan | ||
}); | ||
@@ -139,0 +140,0 @@ }; |
import { TestFramework } from 'stryker-api/test_framework'; | ||
import { StrykerOptions } from 'stryker-api/core'; | ||
export default class TestFrameworkOrchestrator { | ||
private options; | ||
private readonly options; | ||
private readonly log; | ||
@@ -6,0 +6,0 @@ constructor(options: StrykerOptions); |
@@ -5,3 +5,3 @@ "use strict"; | ||
exports.COVERAGE_CURRENT_TEST_VARIABLE_NAME = '__strykerCoverageCurrentTest__'; | ||
var cloneFunctionFragment = " \nfunction clone(source) {\n var result = source;\n if (Array.isArray(source)) {\n result = [];\n source.forEach(function (child, index) {\n result[index] = clone(child);\n });\n } else if (typeof source == \"object\") {\n result = {};\n for (var i in source) {\n result[i] = clone(source[i]);\n }\n }\n return result;\n}"; | ||
var cloneFunctionFragment = "\nfunction clone(source) {\n var result = source;\n if (Array.isArray(source)) {\n result = [];\n source.forEach(function (child, index) {\n result[index] = clone(child);\n });\n } else if (typeof source == \"object\") {\n result = {};\n for (var i in source) {\n result[i] = clone(source[i]);\n }\n }\n return result;\n}"; | ||
var BEFORE_EACH_FRAGMENT_PER_TEST = "\nif (!globalCoverage.baseline && window." + exports.COVERAGE_CURRENT_TEST_VARIABLE_NAME + ") {\nglobalCoverage.baseline = clone(window." + exports.COVERAGE_CURRENT_TEST_VARIABLE_NAME + ");\n}"; | ||
@@ -8,0 +8,0 @@ var AFTER_EACH_FRAGMENT_PER_TEST = "\nglobalCoverage.deviations[id] = coverageResult = {};\nid++;\nvar coveragePerFile = window." + exports.COVERAGE_CURRENT_TEST_VARIABLE_NAME + ";\nif(coveragePerFile) {\nObject.keys(coveragePerFile).forEach(function (file) {\n var coverage = coveragePerFile[file];\n var baseline = globalCoverage.baseline[file];\n var fileResult = { s: {}, f: {} };\n var touchedFile = false;\n for(var i in coverage.s){\n if(coverage.s[i] !== baseline.s[i]){\n fileResult.s[i] = coverage.s[i];\n touchedFile = true;\n }\n }\n for(var i in coverage.f){\n if(coverage.f[i] !== baseline.f[i]){\n fileResult.f[i] = coverage.f[i];\n touchedFile = true;\n }\n }\n if(touchedFile){\n coverageResult[file] = fileResult;\n }\n});\n}"; |
@@ -16,5 +16,5 @@ import { Transpiler } from 'stryker-api/transpile'; | ||
export default class CoverageInstrumenterTranspiler implements Transpiler { | ||
private settings; | ||
private filesToInstrument; | ||
private instrumenter; | ||
private readonly settings; | ||
private readonly filesToInstrument; | ||
private readonly instrumenter; | ||
fileCoverageMaps: CoverageMapsByFile; | ||
@@ -21,0 +21,0 @@ constructor(settings: StrykerOptions, filesToInstrument: ReadonlyArray<string>); |
@@ -84,4 +84,4 @@ "use strict"; | ||
var output = { | ||
statementMap: input.statementMap, | ||
fnMap: {} | ||
fnMap: {}, | ||
statementMap: input.statementMap | ||
}; | ||
@@ -88,0 +88,0 @@ Object.keys(input.fnMap).forEach(function (key) { return output.fnMap[key] = input.fnMap[key].loc; }); |
@@ -8,4 +8,4 @@ import { Observable } from 'rxjs'; | ||
export default class MutantTranspiler { | ||
private transpilerChildProcess; | ||
private proxy; | ||
private readonly transpilerChildProcess; | ||
private readonly proxy; | ||
private currentMutatedFile; | ||
@@ -12,0 +12,0 @@ private unMutatedFiles; |
@@ -26,5 +26,5 @@ import { File, Location } from 'stryker-api/core'; | ||
export declare class TranspiledSourceMapper extends SourceMapper { | ||
private transpiledFiles; | ||
private readonly transpiledFiles; | ||
private sourceMaps; | ||
private log; | ||
private readonly log; | ||
constructor(transpiledFiles: ReadonlyArray<File>); | ||
@@ -31,0 +31,0 @@ /** |
@@ -68,4 +68,4 @@ "use strict"; | ||
location: { | ||
start: start, | ||
end: end | ||
end: end, | ||
start: start | ||
} | ||
@@ -225,4 +225,4 @@ }; | ||
return { | ||
line: transpiledPosition.line - 1, | ||
column: transpiledPosition.column | ||
column: transpiledPosition.column, | ||
line: transpiledPosition.line - 1 // Stryker works 0-based | ||
}; | ||
@@ -229,0 +229,0 @@ }; |
import { File } from 'stryker-api/core'; | ||
import { Transpiler, TranspilerOptions } from 'stryker-api/transpile'; | ||
export default class TranspilerFacade implements Transpiler { | ||
private innerTranspilers; | ||
private readonly innerTranspilers; | ||
constructor(options: TranspilerOptions); | ||
@@ -6,0 +6,0 @@ transpile(files: ReadonlyArray<File>): Promise<ReadonlyArray<File>>; |
import { Location } from 'stryker-api/core'; | ||
export default class LocationHelper { | ||
private loc; | ||
private readonly loc; | ||
static MAX_VALUE: LocationHelper; | ||
constructor(loc: Location); | ||
/** | ||
* Indicates whether the current location is covered by an other location. | ||
* @param maybeWrapper The location that is questioned to be wrapping this location. | ||
* @returns true if this location is covered by given location, otherwise false | ||
*/ | ||
* Indicates whether the current location is covered by an other location. | ||
* @param maybeWrapper The location that is questioned to be wrapping this location. | ||
* @returns true if this location is covered by given location, otherwise false | ||
*/ | ||
isCoveredBy(maybeWrapper: Location): boolean; | ||
@@ -12,0 +12,0 @@ /** |
@@ -8,6 +8,6 @@ "use strict"; | ||
/** | ||
* Indicates whether the current location is covered by an other location. | ||
* @param maybeWrapper The location that is questioned to be wrapping this location. | ||
* @returns true if this location is covered by given location, otherwise false | ||
*/ | ||
* Indicates whether the current location is covered by an other location. | ||
* @param maybeWrapper The location that is questioned to be wrapping this location. | ||
* @returns true if this location is covered by given location, otherwise false | ||
*/ | ||
LocationHelper.prototype.isCoveredBy = function (maybeWrapper) { | ||
@@ -36,4 +36,4 @@ var isAfterStart = this.loc.start.line > maybeWrapper.start.line || | ||
LocationHelper.MAX_VALUE = new LocationHelper(Object.freeze({ | ||
start: Object.freeze({ column: 0, line: -1 }), | ||
end: Object.freeze({ column: Number.POSITIVE_INFINITY, line: Number.POSITIVE_INFINITY }) | ||
end: Object.freeze({ column: Number.POSITIVE_INFINITY, line: Number.POSITIVE_INFINITY }), | ||
start: Object.freeze({ column: 0, line: -1 }) | ||
})); | ||
@@ -40,0 +40,0 @@ return LocationHelper; |
@@ -19,3 +19,3 @@ "use strict"; | ||
function isPromise(input) { | ||
return input && typeof input['then'] === 'function'; | ||
return input && typeof input.then === 'function'; | ||
} | ||
@@ -22,0 +22,0 @@ exports.isPromise = isPromise; |
@@ -11,6 +11,6 @@ import * as estree from 'estree'; | ||
/** | ||
* Parses a Node to generate code. | ||
* @param The Node which has to be transformed into code. | ||
* @returns The generated code. | ||
*/ | ||
* Parses a Node to generate code. | ||
* @param The Node which has to be transformed into code. | ||
* @returns The generated code. | ||
*/ | ||
export declare function generate(node: estree.Node): string; | ||
@@ -17,0 +17,0 @@ /** |
@@ -5,3 +5,3 @@ "use strict"; | ||
var esprima = require("esprima"); | ||
var escodegen = require('escodegen'); | ||
var escodegen = require("escodegen"); | ||
/** | ||
@@ -32,6 +32,6 @@ * Utility class for parsing and generating code. | ||
/** | ||
* Parses a Node to generate code. | ||
* @param The Node which has to be transformed into code. | ||
* @returns The generated code. | ||
*/ | ||
* Parses a Node to generate code. | ||
* @param The Node which has to be transformed into code. | ||
* @returns The generated code. | ||
*/ | ||
function generate(node) { | ||
@@ -38,0 +38,0 @@ return escodegen.generate(node); |
export default class StringBuilder { | ||
private currentLength; | ||
private strings; | ||
private readonly strings; | ||
private readonly maxSize; | ||
@@ -5,0 +5,0 @@ append(str: string): void; |
@@ -20,6 +20,6 @@ /// <reference types="node" /> | ||
declare const _default: { | ||
clean: typeof clean; | ||
createRandomFolder: typeof createRandomFolder; | ||
writeFile: typeof writeFile; | ||
clean: typeof clean; | ||
}; | ||
export default _default; |
@@ -70,6 +70,6 @@ "use strict"; | ||
exports.default = { | ||
clean: clean, | ||
createRandomFolder: createRandomFolder, | ||
writeFile: writeFile, | ||
clean: clean | ||
writeFile: writeFile | ||
}; | ||
//# sourceMappingURL=StrykerTempFolder.js.map |
export default class Timer { | ||
private now; | ||
private readonly now; | ||
private start; | ||
@@ -4,0 +4,0 @@ private markers; |
393222
7088
+ Added@babel/code-frame@7.0.0-beta.51(transitive)
+ Added@babel/generator@7.0.0-beta.51(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.51(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.51(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.51(transitive)
+ Added@babel/highlight@7.0.0-beta.51(transitive)
+ Added@babel/parser@7.0.0-beta.51(transitive)
+ Added@babel/template@7.0.0-beta.51(transitive)
+ Added@babel/traverse@7.0.0-beta.51(transitive)
+ Added@babel/types@7.0.0-beta.51(transitive)
+ Addedcommander@2.18.0(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedistanbul-lib-coverage@2.0.5(transitive)
+ Addedistanbul-lib-instrument@2.3.2(transitive)
+ Addedjsesc@2.5.2(transitive)
+ Addedrxjs@6.3.3(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedbabel-code-frame@6.26.0(transitive)
- Removedbabel-generator@6.26.1(transitive)
- Removedbabel-messages@6.23.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbabel-template@6.26.0(transitive)
- Removedbabel-traverse@6.26.0(transitive)
- Removedbabel-types@6.26.0(transitive)
- Removedbabylon@6.18.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcommander@2.17.1(transitive)
- Removedcore-js@2.6.12(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddetect-indent@4.0.0(transitive)
- Removedglobals@9.18.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedistanbul-lib-coverage@1.2.1(transitive)
- Removedistanbul-lib-instrument@1.10.2(transitive)
- Removedjsesc@1.3.0(transitive)
- Removedms@2.0.0(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedrxjs@6.2.2(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedto-fast-properties@1.0.3(transitive)
Updatedcommander@~2.18.0
Updatedrxjs@~6.3.0