@stryker-mutator/core
Version:
The extendable JavaScript mutation testing framework
40 lines • 1.37 kB
JavaScript
import { progressBarWrapper } from './progress-bar.js';
import { ProgressKeeper } from './progress-keeper.js';
export class ProgressBarReporter extends ProgressKeeper {
progressBar;
onMutationTestingPlanReady(event) {
super.onMutationTestingPlanReady(event);
const progressBarContent = 'Mutation testing [:bar] :percent (elapsed: :et, remaining: :etc) :tested/:mutants Mutants tested (:survived survived, :timedOut timed out)';
this.progressBar = new progressBarWrapper.ProgressBar(progressBarContent, {
complete: '=',
incomplete: ' ',
stream: process.stdout,
total: this.progress.total,
width: 50,
});
}
onMutantTested(result) {
const ticks = super.onMutantTested(result);
const progressBarContent = {
...this.progress,
et: this.getElapsedTime(),
etc: this.getEtc(),
};
if (ticks) {
this.tick(ticks, progressBarContent);
}
else {
this.render(progressBarContent);
}
return ticks;
}
tick(ticks, tickObj) {
this.progressBar?.tick(ticks, tickObj);
}
render(renderObj) {
if (this.progressBar?.total) {
this.progressBar.render(renderObj);
}
}
}
//# sourceMappingURL=progress-reporter.js.map