definition-tester
Version:
DefinitelyTyped repository testing infrastructure
31 lines • 1.12 kB
JavaScript
;
var DefaultTestReporter = (function () {
function DefaultTestReporter(print) {
this.print = print;
this.index = 0;
}
DefaultTestReporter.prototype.printPositiveCharacter = function (testResult) {
if (testResult.attempts > 1) {
this.print.out("\u001B[36m\u001B[1m" + testResult.attempts + "\u001B[0m");
}
else {
this.print.out("\u001B[36m\u001B[1m" + '.' + "\u001B[0m");
}
this.index++;
this.printBreakIfNeeded(this.index);
};
DefaultTestReporter.prototype.printNegativeCharacter = function (testResult) {
this.print.out('x');
this.index++;
this.printBreakIfNeeded(this.index);
};
DefaultTestReporter.prototype.printBreakIfNeeded = function (index) {
if (index % this.print.WIDTH === 0) {
this.print.printBreak();
}
};
return DefaultTestReporter;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = DefaultTestReporter;
//# sourceMappingURL=DefaultReporter.js.map