@dragonshorn-studios/elyseum-cli 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25024,13 +25024,25 @@ class GithubPRCommentCoverageReporter {
25024
25024
  if (diffCoverage.lines.total) {
25025
25025
  // lines, functions, branches average percentage must be greater than or equal to qualityGate
25026
25026
  qualityGateFailed =
25027
- diffCoverage.lines.percent < qualityGateFail ||
25028
- diffCoverage.functions.percent < qualityGateFail ||
25029
- diffCoverage.branches.percent < qualityGateFail;
25027
+ (isNaN(diffCoverage.lines.percent)
25028
+ ? false
25029
+ : diffCoverage.lines.percent < qualityGateFail) ||
25030
+ (isNaN(diffCoverage.functions.percent)
25031
+ ? false
25032
+ : diffCoverage.functions.percent < qualityGateFail) ||
25033
+ (isNaN(diffCoverage.branches.percent)
25034
+ ? false
25035
+ : diffCoverage.branches.percent < qualityGateFail);
25030
25036
  qualityGateWarning =
25031
- diffCoverage.lines.percent < qualityGate ||
25032
- diffCoverage.functions.percent < qualityGate ||
25033
- diffCoverage.branches.percent < qualityGate;
25037
+ (isNaN(diffCoverage.lines.percent)
25038
+ ? false
25039
+ : diffCoverage.lines.percent < qualityGate) ||
25040
+ (isNaN(diffCoverage.functions.percent)
25041
+ ? false
25042
+ : diffCoverage.functions.percent < qualityGate) ||
25043
+ (isNaN(diffCoverage.branches.percent)
25044
+ ? false
25045
+ : diffCoverage.branches.percent < qualityGate);
25034
25046
  let coverageQualityText = ``;
25035
25047
  if (qualityGate) {
25036
25048
  if (qualityGateFailed) {
@@ -25042,15 +25054,15 @@ class GithubPRCommentCoverageReporter {
25042
25054
  else {
25043
25055
  coverageQualityText += `> [!TIP]\n> ### Coverage Quality Gate Passed 🟩\n`;
25044
25056
  }
25045
- coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} Lines: ${diffCoverage.lines.percent.toFixed(2)}% (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
25046
- coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} Functions: ${diffCoverage.functions.percent.toFixed(2)}% (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
25047
- coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} Branches: ${diffCoverage.branches.percent.toFixed(2)}% (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n\n`;
25057
+ coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} Lines: ${this.percentOrNA(diffCoverage.lines.percent)} (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
25058
+ coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} Functions: ${this.percentOrNA(diffCoverage.functions.percent)} (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
25059
+ coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} Branches: ${this.percentOrNA(diffCoverage.branches.percent)} (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n\n`;
25048
25060
  }
25049
25061
  let summary = `| Type | Total | Covered | Percent |\n`;
25050
25062
  summary += `|-----------|-------|---------|---------|\n`;
25051
- summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} ${diffCoverage.lines.percent.toFixed(2)}% |\n`;
25052
- summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} ${diffCoverage.functions.percent.toFixed(2)}% |\n`;
25053
- summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} ${diffCoverage.branches.percent.toFixed(2)}% |\n`;
25063
+ summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} ${this.percentOrNA(diffCoverage.lines.percent)} |\n`;
25064
+ summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} ${this.percentOrNA(diffCoverage.functions.percent)} |\n`;
25065
+ summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} ${this.percentOrNA(diffCoverage.branches.percent)} |\n`;
25054
25066
  markdown += `### Coverage Summary\n\n${summary}`;
25055
25067
  markdown += coverageQualityText;
25056
25068
  let detailsTable = `\n<details>\n<summary>Coverage Details</summary>\n\n`;