From 79387a8c5e351198c7a53e3ba62541ef9ccac467 Mon Sep 17 00:00:00 2001 From: realmarv Date: Mon, 2 Jan 2023 16:24:06 +0330 Subject: [PATCH] test(parser): add failing test --- @commitlint/parse/src/index.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/@commitlint/parse/src/index.test.ts b/@commitlint/parse/src/index.test.ts index 157113c9300..ed1a30bf711 100644 --- a/@commitlint/parse/src/index.test.ts +++ b/@commitlint/parse/src/index.test.ts @@ -168,6 +168,25 @@ test('registers inline #', async () => { expect(actual.body).toBe('things #reference'); }); +test('keep -side notes- in the body section', async () => { + const header = "type(some/scope): subject" + const body = + "CI on master branch caught this:\n\n" + + "```\n" + + "Unhandled Exception:\n" + + "System.AggregateException: One or more errors occurred. (Some problem when connecting to 'api.mycryptoapi.com/eth')\n\n" + + "--- End of stack trace from previous location where exception was thrown ---\n\n" + + "at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206\n" + + "...\n" + + "```"; + + const message = header + "\n" + body + + const actual = await parse(message); + + expect(actual.body).toBe(body); +}); + test('parses references leading subject', async () => { const message = '#1 some subject'; const opts = await require('conventional-changelog-angular');