UNPKG

stryker

Version:
42 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var ProgressKeeper_1 = require("./ProgressKeeper"); var ProgressBar_1 = require("./ProgressBar"); var ProgressBarReporter = /** @class */ (function (_super) { tslib_1.__extends(ProgressBarReporter, _super); function ProgressBarReporter() { return _super !== null && _super.apply(this, arguments) || this; } ProgressBarReporter.prototype.onAllMutantsMatchedWithTests = function (matchedMutants) { _super.prototype.onAllMutantsMatchedWithTests.call(this, matchedMutants); var progressBarContent = "Mutation testing [:bar] :percent (ETC :etc) :tested/:total tested (:survived survived)"; this.progressBar = new ProgressBar_1.default(progressBarContent, { complete: '=', incomplete: ' ', stream: process.stdout, total: this.progress.total, width: 50 }); }; ProgressBarReporter.prototype.onMutantTested = function (result) { var ticksBefore = this.progress.tested; _super.prototype.onMutantTested.call(this, result); var progressBarContent = tslib_1.__assign({}, this.progress, { etc: this.getEtc() }); if (ticksBefore < this.progress.tested) { this.tick(progressBarContent); } else { this.render(progressBarContent); } }; ProgressBarReporter.prototype.tick = function (tickObj) { this.progressBar.tick(tickObj); }; ProgressBarReporter.prototype.render = function (renderObj) { this.progressBar.render(renderObj); }; return ProgressBarReporter; }(ProgressKeeper_1.default)); exports.default = ProgressBarReporter; //# sourceMappingURL=ProgressReporter.js.map