@boost/core
Version:
Robust pipeline for creating dev tools that separate logic into routines and tasks.
39 lines (38 loc) • 1.25 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Reporter_1 = __importDefault(require("../Reporter"));
class CIReporter extends Reporter_1.default {
constructor() {
super(...arguments);
this.routineCount = 0;
this.taskCount = 0;
this.handleRoutine = () => {
this.routineCount += 1;
};
this.handleTask = () => {
this.taskCount += 1;
};
this.handleStop = () => {
const msg = this.tool.msg('app:ciRanIn', {
routineCount: this.routineCount,
taskCount: this.taskCount,
time: this.getElapsedTime(this.startTime, this.stopTime, false),
});
this.console.out(`\n${msg}\n`);
};
}
blueprint() {
return {};
}
bootstrap() {
super.bootstrap();
this.console.disable();
this.console.onStop.listen(this.handleStop);
this.console.onRoutine.listen(this.handleRoutine);
this.console.onTask.listen(this.handleTask);
}
}
exports.default = CIReporter;