UNPKG

stryker

Version:
32 lines 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var os = require("os"); var ProgressKeeper_1 = require("./ProgressKeeper"); var ProgressAppendOnlyReporter = /** @class */ (function (_super) { tslib_1.__extends(ProgressAppendOnlyReporter, _super); function ProgressAppendOnlyReporter() { return _super !== null && _super.apply(this, arguments) || this; } ProgressAppendOnlyReporter.prototype.onAllMutantsMatchedWithTests = function (matchedMutants) { var _this = this; _super.prototype.onAllMutantsMatchedWithTests.call(this, matchedMutants); if (matchedMutants.length) { this.intervalReference = setInterval(function () { return _this.render(); }, 10000); } }; ProgressAppendOnlyReporter.prototype.onAllMutantsTested = function () { clearInterval(this.intervalReference); }; ProgressAppendOnlyReporter.prototype.render = function () { process.stdout.write("Mutation testing " + this.getPercentDone() + " (ETC " + this.getEtc() + ") " + (this.progress.tested + "/" + this.progress.total + " tested (" + this.progress.survived + " survived)") + os.EOL); }; ProgressAppendOnlyReporter.prototype.getPercentDone = function () { return Math.floor(this.progress.tested / this.progress.total * 100) + '%'; }; return ProgressAppendOnlyReporter; }(ProgressKeeper_1.default)); exports.default = ProgressAppendOnlyReporter; //# sourceMappingURL=ProgressAppendOnlyReporter.js.map