@betterer/reporter
Advanced tools
Comparing version 2.2.3 to 2.3.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.3.0](https://github.com/phenomnomnominal/betterer/compare/v2.2.3...v2.3.0) (2020-06-30) | ||
### Features | ||
* **betterer ✨:** removing score mechanism from core lib ([#139](https://github.com/phenomnomnominal/betterer/issues/139)) ([145c883](https://github.com/phenomnomnominal/betterer/commit/145c8830741d9ec9d999e09b94671fc405de21c9)) | ||
## [2.2.3](https://github.com/phenomnomnominal/betterer/compare/v2.2.2...v2.2.3) (2020-06-30) | ||
@@ -8,0 +19,0 @@ |
@@ -13,3 +13,1 @@ export declare function testBetter(context: string): string; | ||
export declare function getTests(count: number): string; | ||
export declare function scoreHeader(): string; | ||
export declare function scoreList(author: string, score: number, place: number): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.scoreList = exports.scoreHeader = exports.getTests = exports.testWorse = exports.testSkipped = exports.testSame = exports.testRunning = exports.testObsolete = exports.testNew = exports.testFailed = exports.testExpired = exports.testComplete = exports.testChecked = exports.testBetter = void 0; | ||
exports.getTests = exports.testWorse = exports.testSkipped = exports.testSame = exports.testRunning = exports.testObsolete = exports.testNew = exports.testFailed = exports.testExpired = exports.testComplete = exports.testChecked = exports.testBetter = void 0; | ||
function testBetter(context) { | ||
@@ -53,15 +53,2 @@ return context + " got better! \uD83D\uDE0D"; | ||
exports.getTests = getTests; | ||
var SCORE_EMOJIS = ['🥇', '🥈', '🥉']; | ||
var DEFAULT_SCORE_EMOJI = '👍'; | ||
function scoreHeader() { | ||
return "\uD83C\uDFC6 Betterer leaderboard! \uD83C\uDFC6"; | ||
} | ||
exports.scoreHeader = scoreHeader; | ||
function scoreList(author, score, place) { | ||
return (SCORE_EMOJIS[place] || DEFAULT_SCORE_EMOJI) + " " + author + " on " + getPoints(score); | ||
} | ||
exports.scoreList = scoreList; | ||
function getPoints(score) { | ||
return score + " " + (score === 1 ? 'point' : 'points'); | ||
} | ||
//# sourceMappingURL=messages.js.map |
@@ -90,26 +90,4 @@ "use strict"; | ||
} | ||
}, | ||
score: function (scores) { | ||
var authorScores = Object.entries(scores); | ||
var sorted = authorScores.sort(function (_a, _b) { | ||
var aScore = _a[1]; | ||
var bScore = _b[1]; | ||
return bScore - aScore; | ||
}); | ||
logger_1.info(messages_1.scoreHeader()); | ||
sorted.forEach(function (_a, index) { | ||
var author = _a[0], score = _a[1]; | ||
var result = messages_1.scoreList(author, score, index); | ||
if (score > 0 && index < 3) { | ||
logger_1.success(result); | ||
return; | ||
} | ||
if (score > 0) { | ||
logger_1.warn(result); | ||
return; | ||
} | ||
logger_1.error(result); | ||
}); | ||
} | ||
}; | ||
//# sourceMappingURL=reporter.js.map |
{ | ||
"name": "@betterer/reporter", | ||
"description": "Default reporter @betterer/betterer", | ||
"version": "2.2.3", | ||
"version": "2.3.0", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "publishConfig": { | ||
"dependencies": { | ||
"@betterer/betterer": "^2.2.3", | ||
"@betterer/betterer": "^2.3.0", | ||
"@betterer/errors": "^2.2.3", | ||
@@ -33,3 +33,3 @@ "@betterer/logger": "^2.2.3", | ||
}, | ||
"gitHead": "9a7639a777a2906bdabdbd5c187d6b8fe3c809d4" | ||
"gitHead": "d349f75d8ae61c829064fef23dcb0d51193b253c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15734
191
Updated@betterer/betterer@^2.3.0