diff --git a/package.json b/package.json index 4f4e5a5..d01a4e1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/check-references.js b/src/check-references.js index 7f3ec78..3b2826a 100644 --- a/src/check-references.js +++ b/src/check-references.js @@ -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) }