@skills17/test-result-printer
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -14,4 +14,6 @@ import { TestRun } from '@skills17/test-result'; | ||
}): void; | ||
private getPointsColor; | ||
private printTotal; | ||
private printWarnings; | ||
private printTestWarning; | ||
} |
@@ -44,13 +44,5 @@ "use strict"; | ||
const pointsText = `${points}/${maxPoints} point${maxPoints !== 1 ? 's' : ''}`; | ||
let pointsColor = _chalk.green; | ||
const pointsColor = this.getPointsColor(points, maxPoints); | ||
let manualCheck = ''; | ||
if (points < maxPoints) { | ||
if (points > 0) { | ||
pointsColor = _chalk.yellow; | ||
} else { | ||
pointsColor = _chalk.red; | ||
} | ||
} | ||
if (group.requiresManualCheck()) { | ||
@@ -87,2 +79,6 @@ manualCheck = (0, _chalk.bold)((0, _chalk.yellow)(' [manual check required]')); | ||
if (printFooter) { | ||
if (printPoints) { | ||
this.printTotal(printer); | ||
} | ||
printer(`\n${(0, _chalk.blue)('Info:')}`, 'The detailed test and error information is visible above the result summary.'); | ||
@@ -95,2 +91,19 @@ } | ||
getPointsColor(points, maxPoints) { | ||
if (points > 0) { | ||
return points === maxPoints ? _chalk.green : _chalk.yellow; | ||
} | ||
return _chalk.red; | ||
} | ||
printTotal(printer) { | ||
const totalPoints = this.run.getGroups().reduce((groupPoints, group) => groupPoints + group.getPoints(), 0); | ||
const totalMaxPoints = this.run.getGroups().reduce((groupPoints, group) => groupPoints + group.getMaxPoints(), 0); | ||
const totalPointsRounded = Math.round(totalPoints * 100) / 100; | ||
const totalMaxPointsRounded = Math.round(totalMaxPoints * 100) / 100; | ||
const totalPointsColor = this.getPointsColor(totalPoints, totalMaxPoints); | ||
printer(`\nTotal: ${totalPointsColor(`${totalPointsRounded}/${totalMaxPointsRounded} point${totalMaxPointsRounded !== 1 ? 's' : ''}`)}`); | ||
} | ||
printWarnings(printer) { | ||
@@ -97,0 +110,0 @@ // search for groups without tests |
{ | ||
"name": "@skills17/test-result-printer", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"description": "Prints test results in a nice format to the console.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10027
139
1