@actualwave/traceability-matrices
Advanced tools
Comparing version 0.0.9 to 0.0.10
49
cli.js
@@ -116,23 +116,32 @@ #!/usr/bin/env node | ||
break; | ||
case "threshold": | ||
{ | ||
// threshold --total=80 --per-project=40 | ||
const total = | ||
args["total"] === undefined ? 100 : parseInt(args["total"], 10); | ||
const perProject = | ||
args["per-project"] === undefined | ||
? 100 | ||
: parseInt(args["per-project"], 10); | ||
if (isNaN(total) || isNaN(perProject)) { | ||
exitWithError( | ||
"Coverage thresholds should be positive integer values between 0 and 100." | ||
); | ||
case "threshold": | ||
{ | ||
// threshold --target-dir= --total=80 --per-project=40 | ||
const total = | ||
args["total"] === undefined ? 100 : parseInt(args["total"], 10); | ||
const perProject = | ||
args["per-project"] === undefined | ||
? 100 | ||
: parseInt(args["per-project"], 10); | ||
if (isNaN(total) || isNaN(perProject)) { | ||
exitWithError( | ||
"Coverage thresholds should be positive integer values between 0 and 100." | ||
); | ||
} | ||
const { threshold } = require("./commands/threshold.js"); | ||
threshold(targetDirs, total, perProject); | ||
} | ||
const { threshold } = require("./commands/threshold.js"); | ||
threshold(targetDirs, total, perProject); | ||
} | ||
break; | ||
break; | ||
case "stats": | ||
{ | ||
// stats --target-dir= | ||
const { stats } = require("./commands/stats.js"); | ||
stats(targetDirs); | ||
} | ||
break; | ||
case "help": | ||
@@ -139,0 +148,0 @@ // TODO |
@@ -12,2 +12,3 @@ const { readCoverage } = require("../reader/reader"); | ||
const list = Object.values(projects); | ||
let projectCount = list.length; | ||
let error = false; | ||
@@ -22,5 +23,13 @@ let combinedCoverage = 0; | ||
calculateProjectStats(project); | ||
const coverage = (requirementsCovered / requirementsTotal) * 100; | ||
combinedCoverage += coverage; | ||
const coverage = requirementsTotal | ||
? (requirementsCovered / requirementsTotal) * 100 | ||
: 100; | ||
if (requirementsTotal) { | ||
combinedCoverage += coverage; | ||
} else { | ||
// exclude empty projects from total coverage calculation | ||
projectCount--; | ||
} | ||
const str = `${coverage.toFixed(0).padStart(4, " ")}% - ${project.title}`; | ||
@@ -37,3 +46,3 @@ | ||
const totalCoverage = combinedCoverage / list.length; | ||
const totalCoverage = combinedCoverage / projectCount; | ||
const str = `${totalCoverage.toFixed(0).padStart(4, " ")}% - Global coverage`; | ||
@@ -40,0 +49,0 @@ |
{ | ||
"name": "@actualwave/traceability-matrices", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"types": "cypress.d.ts", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -114,2 +114,11 @@ # @actualwave/traceability-matrices | ||
### traceability-matrices stats | ||
Outputs coverage information per project with requirements. | ||
Example: | ||
``` | ||
traceability-matrices stats --target-dir=cypress/coverage | ||
``` | ||
## Cypress integration | ||
@@ -116,0 +125,0 @@ |
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
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
62377
27
1561
334