Skip to content

Commit

Permalink
fix: do not try to show milestone if there is none
Browse files Browse the repository at this point in the history
  • Loading branch information
edd committed Jan 12, 2024
1 parent d570cd3 commit 4ec15ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vegaprotocol/approbation",
"version": "4.7.0",
"version": "4.7.1",
"description": "Match Acceptance Criteria Codes with the tests that test them",
"engine": ">= 18",
"bin": "./bin/approbation.js",
Expand Down
9 changes: 7 additions & 2 deletions src/check-references.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,15 @@ function checkReferences(specsGlob, testsGlob, categoriesPath, ignoreGlob, featu
}

if (shouldOutputJenkins) {
const currentMilestone = totals.pop()
const currentMilestone = totals && totals.length > 0 ? totals.pop() : false

const skipCategories = ['Category', 'Specs', 'Acceptable']
let jenkinsLine = `All ACs: ${Object.entries(categories.pop()).map(([key, value]) => skipCategories.indexOf(key) === -1 ? `*${key}*: ${value}` : '').join(' ').trim()}`
jenkinsLine += `\r\nCurrent milestone ACs: *${currentMilestone.Milestone}*: ${currentMilestone.Coverage}`

if (currentMilestone) {
jenkinsLine += `\r\nCurrent milestone ACs: *${currentMilestone.Milestone}*: ${currentMilestone.Coverage}`
}

fs.writeFileSync(`${outputPath}/jenkins.txt`, jenkinsLine)
}

Expand Down

0 comments on commit 4ec15ff

Please sign in to comment.