stryker
Version:
The extendable JavaScript mutation testing framework
40 lines • 1.92 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var plugin_1 = require("stryker-api/plugin");
var di_1 = require("./di");
var TestFrameworkOrchestrator = /** @class */ (function () {
function TestFrameworkOrchestrator(log, options, pluginCreator) {
this.log = log;
this.options = options;
this.pluginCreator = pluginCreator;
}
TestFrameworkOrchestrator.prototype.determineTestFramework = function () {
if (this.options.coverageAnalysis !== 'perTest') {
this.log.debug('The `coverageAnalysis` setting is "%s", not hooking into the test framework to achieve performance benefits.', this.options.coverageAnalysis);
return null;
}
else {
return this.determineFrameworkWithCoverageAnalysis();
}
};
TestFrameworkOrchestrator.prototype.determineFrameworkWithCoverageAnalysis = function () {
var testFramework = null;
if (this.options.testFramework) {
try {
testFramework = this.pluginCreator.create(this.options.testFramework);
this.log.debug("Using testFramework " + this.options.testFramework + " based on `testFramework` setting");
}
catch (error) {
this.log.warn("Could not create test framework `" + this.options.testFramework + "`", error);
}
}
else {
this.log.warn('Missing config settings `testFramework`. Set `coverageAnalysis` option explicitly to "off" to ignore this warning.');
}
return testFramework;
};
TestFrameworkOrchestrator.inject = plugin_1.tokens(plugin_1.commonTokens.logger, plugin_1.commonTokens.options, di_1.coreTokens.pluginCreatorTestFramework);
return TestFrameworkOrchestrator;
}());
exports.default = TestFrameworkOrchestrator;
//# sourceMappingURL=TestFrameworkOrchestrator.js.map