From fc15ea1b2c333ee7db0603484a6588dca23aea8e Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Thu, 16 Jan 2025 14:38:54 -0300 Subject: [PATCH] fix: add whitespace after cveId (#174) --- commit-to-output.js | 2 +- test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/commit-to-output.js b/commit-to-output.js index dfc5f74..31bbfdb 100644 --- a/commit-to-output.js +++ b/commit-to-output.js @@ -41,7 +41,7 @@ function toStringPlaintext (data) { let s = '' if (data.cveId) { - s += `(${data.cveId})` + s += `(${data.cveId}) ` } s += (data.semver || []).length ? `(${data.semver.join(', ').toUpperCase()}) ` : '' diff --git a/test.js b/test.js index 5bdff02..2e2791c 100644 --- a/test.js +++ b/test.js @@ -169,3 +169,13 @@ test('test conventionalcommit style', (t) => { `) t.end() }) + +test('test plaintext, CVE-ID', (t) => { + const out = exec('--start-ref=43d428b3d2 --end-ref=43d428b3d2 --group --filter-release --plaintext') + t.equal( + out, + `feat: + * (CVE-2024-22020) add cveId support to commmit output (RafaelGSS) https://github.com/nodejs/node/pull/55819 +`) + t.end() +})