diff --git a/src/report/metrics.js b/src/report/metrics.js index c6414c3b4..0342fb78f 100644 --- a/src/report/metrics.js +++ b/src/report/metrics.js @@ -3,7 +3,7 @@ const chalk = require("chalk"); const utl = require("./utl"); const DECIMAL_BASE = 10; -const METRIC_WIDTH = 4; +const METRIC_WIDTH = 5; const COMPONENT_HEADER = "name"; function getHeader(pMaxNameWidth) { @@ -11,7 +11,7 @@ function getHeader(pMaxNameWidth) { METRIC_WIDTH + 1 )} ${"Ca".padStart(METRIC_WIDTH + 1)} ${"Ce".padStart( METRIC_WIDTH + 1 - )} ${"I (%)".padEnd(METRIC_WIDTH + 1)}`; + )} ${"I (%)".padStart(METRIC_WIDTH + 1)}`; } function getDemarcationLine(pMaxNameWidth) { @@ -19,7 +19,7 @@ function getDemarcationLine(pMaxNameWidth) { METRIC_WIDTH + 1 )} ${"-".repeat(METRIC_WIDTH + 1)} ${"-".repeat( METRIC_WIDTH + 1 - )} ${"-".repeat(METRIC_WIDTH + 1)}`; + )} ${"-".repeat(METRIC_WIDTH + 1)}`; } function getMetricsTable(pMetrics, pMaxNameWidth) { @@ -39,7 +39,6 @@ function getMetricsTable(pMetrics, pMaxNameWidth) { .toString(DECIMAL_BASE) .padStart(METRIC_WIDTH)} ${utl .formatPercentage(instability) - .toString(DECIMAL_BASE) .padStart(METRIC_WIDTH)}` ); } diff --git a/test/report/metrics/metrics.spec.mjs b/test/report/metrics/metrics.spec.mjs index 87f6ff193..65cfa1fc3 100644 --- a/test/report/metrics/metrics.spec.mjs +++ b/test/report/metrics/metrics.spec.mjs @@ -26,7 +26,7 @@ describe("[I] report/metrics", () => { }); expect(lResult.exitCode).to.equal(0); - expect(lResult.output).to.contain("src 1 1 1 50%"); + expect(lResult.output).to.contain("src 1 1 1 50%"); }); it("does not emit folder metrics when asked to hide them", () => { @@ -47,7 +47,7 @@ describe("[I] report/metrics", () => { ); expect(lResult.exitCode).to.equal(0); - expect(lResult.output).to.not.contain("src 1 1 1 50%"); + expect(lResult.output).to.not.contain("src 1 1 1 50%"); }); it("emits module metrics (sorted by instability by default)", () => { @@ -77,7 +77,7 @@ describe("[I] report/metrics", () => { expect(lResult.exitCode).to.equal(0); expect(lResult.output).to.contain( - `src/mies.js 1 1 1 50%${EOL}src/aap.js 1 1 3 25%${EOL}src/noot.js` + `src/mies.js 1 1 1 50%${EOL}src/aap.js 1 1 3 25%${EOL}src/noot.js` ); }); @@ -111,7 +111,7 @@ describe("[I] report/metrics", () => { expect(lResult.exitCode).to.equal(0); expect(lResult.output).to.contain( - `src/aap.js 1 1 3 25%${EOL}src/mies.js 1 1 1 50%${EOL}src/noot.js` + `src/aap.js 1 1 3 25%${EOL}src/mies.js 1 1 1 50%${EOL}src/noot.js` ); }); @@ -145,7 +145,7 @@ describe("[I] report/metrics", () => { expect(lResult.exitCode).to.equal(0); expect(lResult.output).to.not.contain( - `src/mies.js 1 1 1 50${EOL}src/aap.js 1 1 3 25%${EOL}src/noot.js` + `src/mies.js 1 1 1 50%${EOL}src/aap.js 1 1 3 25%${EOL}src/noot.js` ); });