UNPKG

poku

Version:

🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.

37 lines (36 loc) 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.focus = void 0; const reporter_js_1 = require("../../builders/reporter.js"); const time_js_1 = require("../../parsers/time.js"); const format_js_1 = require("../format.js"); const write_js_1 = require("../write.js"); exports.focus = (() => { let countFails = 0; return (0, reporter_js_1.createReporter)({ onRunStart() { }, onDescribeAsTitle() { }, onDescribeStart() { }, onDescribeEnd() { }, onItStart() { }, onItEnd() { }, onAssertionSuccess() { }, onTodoModifier() { }, onSkipModifier() { }, onSkipFile() { }, onFileResult({ status, output }) { if (!status) { countFails++; if (output) (0, write_js_1.log)(output); } }, onExit({ timespan, results }) { if (countFails > 0) (0, write_js_1.hr)(); (0, write_js_1.log)(`${(0, format_js_1.format)(String(results.passed)).bold().dim()} ${(0, format_js_1.format)('test file(s) passed').dim()}`); (0, write_js_1.log)(`${(0, format_js_1.format)(String(results.failed)).bold().dim()} ${(0, format_js_1.format)('test file(s) failed').dim()}`); (0, write_js_1.log)(`${(0, format_js_1.format)(`Finished in ±${(0, time_js_1.parseTimeToSecs)(timespan.duration)} seconds`).dim()}`); }, }); })();