1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const plugin_1 = require("@stryker-mutator/api/plugin");
|
4 | const di_1 = require("./di");
|
5 | let TestFrameworkOrchestrator = (() => {
|
6 | class TestFrameworkOrchestrator {
|
7 | constructor(log, options, pluginCreator) {
|
8 | this.log = log;
|
9 | this.options = options;
|
10 | this.pluginCreator = pluginCreator;
|
11 | }
|
12 | determineTestFramework() {
|
13 | if (this.options.coverageAnalysis !== 'perTest') {
|
14 | this.log.debug('The `coverageAnalysis` setting is "%s", not hooking into the test framework to achieve performance benefits.', this.options.coverageAnalysis);
|
15 | return null;
|
16 | }
|
17 | else {
|
18 | return this.determineFrameworkWithCoverageAnalysis();
|
19 | }
|
20 | }
|
21 | determineFrameworkWithCoverageAnalysis() {
|
22 | let testFramework = null;
|
23 | if (this.options.testFramework) {
|
24 | try {
|
25 | testFramework = this.pluginCreator.create(this.options.testFramework);
|
26 | this.log.debug(`Using testFramework ${this.options.testFramework} based on \`testFramework\` setting`);
|
27 | }
|
28 | catch (error) {
|
29 | this.log.warn(`Could not create test framework \`${this.options.testFramework}\``, error);
|
30 | }
|
31 | }
|
32 | else {
|
33 | this.log.warn('Missing config settings `testFramework`. Set `coverageAnalysis` option explicitly to "off" to ignore this warning.');
|
34 | }
|
35 | return testFramework;
|
36 | }
|
37 | }
|
38 | TestFrameworkOrchestrator.inject = plugin_1.tokens(plugin_1.commonTokens.logger, plugin_1.commonTokens.options, di_1.coreTokens.pluginCreatorTestFramework);
|
39 | return TestFrameworkOrchestrator;
|
40 | })();
|
41 | exports.default = TestFrameworkOrchestrator;
|
42 |
|
\ | No newline at end of file |