skutter
Version:
Skutter: Opinionated BDD Browser based test framework
24 lines (23 loc) • 1.44 kB
JavaScript
;
const chalk = require("chalk");
const reporter_base_1 = require("./reporter-base");
const stop_watch_1 = require("../services/stop-watch");
const run_totals_calculator_1 = require("../services/run-totals-calculator");
class RunTotalsReporter extends reporter_base_1.ReporterBase {
constructor(...args) {
super(...args);
this._stopWatch = new stop_watch_1.StopWatch();
}
runStarting() {
this._stopWatch.start();
}
runCompleted(results) {
this._stopWatch.stop();
let totals = run_totals_calculator_1.RunTotalsCalculator.get(results);
console.log(`[Features] Total: ${totals.features.total}, ${chalk.green("Passed:")} ${totals.features.passed}, ${chalk.red("Errored:")} ${totals.features.errored}, ${chalk.red("Failed:")} ${totals.features.failed}, ${chalk.yellow("Skipped:")} ${totals.features.skipped}`);
console.log(`[Scenarios] Total: ${totals.scenarios.total}, ${chalk.green("Passed:")} ${totals.scenarios.passed}, ${chalk.red("Errored:")} ${totals.scenarios.errored}, ${chalk.red("Failed:")} ${totals.scenarios.failed}, ${chalk.yellow("Skipped:")} ${totals.scenarios.skipped}`);
console.log(`Execution duration: ${chalk.bgCyan(this._stopWatch.elapsedSeconds.toFixed(2).toString())}s, Sequential duration: ${chalk.bgCyan(totals.features.duration.toFixed(2).toString())}s`);
}
;
}
exports.RunTotalsReporter = RunTotalsReporter;