From c6869033521dd5d877928e0f5b2274d23bfec840 Mon Sep 17 00:00:00 2001 From: Edd Date: Thu, 3 Aug 2023 16:43:04 +0100 Subject: [PATCH] fix: do not crash if features is set but empty --- package-lock.json | 4 ++-- package.json | 2 +- src/check-references.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3bbd8de..4f88e73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vegaprotocol/approbation", - "version": "4.5.0", + "version": "4.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vegaprotocol/approbation", - "version": "4.5.0", + "version": "4.5.1", "license": "Unlicense", "dependencies": { "console-table-printer": "^2.10.0", diff --git a/package.json b/package.json index 52c10bb..2759fdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vegaprotocol/approbation", - "version": "4.5.0", + "version": "4.5.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 5375615..18e432e 100644 --- a/src/check-references.js +++ b/src/check-references.js @@ -221,7 +221,7 @@ function checkReferences (specsGlob, testsGlob, categoriesPath, ignoreGlob, feat setCategories(specCategories) // Features gather Acceptance Criteria across spec files or categories, and tally the numbers - if (featuresPath !== undefined) { + if (featuresPath !== undefined && featuresPath.length > 0) { specFeatures = setFeatures(JSON.parse(fs.readFileSync(featuresPath))) }