From fb688cc2f5e3e548a1b67e9282bf273ad1f87e54 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Sat, 2 Mar 2024 20:24:08 +0000 Subject: [PATCH] - fix formatting --- .../releaseNotesBuilderPullGitea.test.ts | 2 +- __tests__/releaseNotesBuilderPull.test.ts | 24 +++++++++++-------- __tests__/transformNested.test.ts | 4 +++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/__tests__/gitea/releaseNotesBuilderPullGitea.test.ts b/__tests__/gitea/releaseNotesBuilderPullGitea.test.ts index 0bd2120e..03f3bec4 100644 --- a/__tests__/gitea/releaseNotesBuilderPullGitea.test.ts +++ b/__tests__/gitea/releaseNotesBuilderPullGitea.test.ts @@ -3,7 +3,7 @@ import {buildChangelog} from '../../src/transform' import {Options, pullData} from '../../src/pr-collector/prCollector' import {GiteaRepository} from '../../src/repositories/GiteaRepository' import {clear} from '../../src/transform' -import { ReleaseNotesOptions } from '../../src/releaseNotesBuilder' +import {ReleaseNotesOptions} from '../../src/releaseNotesBuilder' jest.setTimeout(180000) clear() diff --git a/__tests__/releaseNotesBuilderPull.test.ts b/__tests__/releaseNotesBuilderPull.test.ts index 32e59d8e..eda9b06e 100644 --- a/__tests__/releaseNotesBuilderPull.test.ts +++ b/__tests__/releaseNotesBuilderPull.test.ts @@ -3,7 +3,7 @@ import {buildChangelog} from '../src/transform' import {Options, pullData} from '../src/pr-collector/prCollector' import {GithubRepository} from '../src/repositories/GithubRepository' import {clear} from '../src/transform' -import { ReleaseNotesOptions } from '../src/releaseNotesBuilder' +import {ReleaseNotesOptions} from '../src/releaseNotesBuilder' jest.setTimeout(180000) clear() @@ -359,21 +359,23 @@ it('Default configuration with commit mode', async () => { } const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, options as ReleaseNotesOptions) console.log(changeLog) - expect(changeLog).toStrictEqual(`## ๐Ÿš€ Features\n\n- feat(lang): add Bengali\n- feat(lang): add uzbek translation (#558)\n\n## ๐Ÿ› Fixes\n\n- fix: Fix grammar and consistency in french translation (#546)\n- fix(ja): fix typo\n- fix(zh-hant): Distinguish translations of 'Release/Publish'\n- fix(ko): fix translation typo for message (#567)\n\n## ๐Ÿ“ฆ Other\n\n- doc: new thi.ng links and descriptions\n- docs: add link to git-changelog-command-line docker image\n- docs: Add descriptions for commit types\n\n`) + expect(changeLog).toStrictEqual( + `## ๐Ÿš€ Features\n\n- feat(lang): add Bengali\n- feat(lang): add uzbek translation (#558)\n\n## ๐Ÿ› Fixes\n\n- fix: Fix grammar and consistency in french translation (#546)\n- fix(ja): fix typo\n- fix(zh-hant): Distinguish translations of 'Release/Publish'\n- fix(ko): fix translation typo for message (#567)\n\n## ๐Ÿ“ฆ Other\n\n- doc: new thi.ng links and descriptions\n- docs: add link to git-changelog-command-line docker image\n- docs: Add descriptions for commit types\n\n` + ) }) it('Default configuration with commit mode and custom placeholder', async () => { const configuration = Object.assign({}, mergeConfiguration(undefined, undefined, 'COMMIT')) - configuration.pr_template = "- #{{TITLE_ONLY}}" + configuration.pr_template = '- #{{TITLE_ONLY}}' configuration.trim_values = true configuration.custom_placeholders = [ { - "name": "TITLE_ONLY", - "source": "TITLE", - "transformer": { - "method": "regexr", - "pattern": "(\\w+(\\(.+\\))?: ?)?(.+)", - "target": "$3" + name: 'TITLE_ONLY', + source: 'TITLE', + transformer: { + method: 'regexr', + pattern: '(\\w+(\\(.+\\))?: ?)?(.+)', + target: '$3' } } ] @@ -401,5 +403,7 @@ it('Default configuration with commit mode and custom placeholder', async () => } const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, options as ReleaseNotesOptions) console.log(changeLog) - expect(changeLog).toStrictEqual(`## ๐Ÿš€ Features\n\n- add Bengali\n- add uzbek translation (#558)\n\n## ๐Ÿ› Fixes\n\n- Fix grammar and consistency in french translation (#546)\n- fix typo\n- Distinguish translations of 'Release/Publish'\n- fix translation typo for message (#567)\n\n## ๐Ÿ“ฆ Other\n\n- new thi.ng links and descriptions\n- add link to git-changelog-command-line docker image\n- Add descriptions for commit types`) + expect(changeLog).toStrictEqual( + `## ๐Ÿš€ Features\n\n- add Bengali\n- add uzbek translation (#558)\n\n## ๐Ÿ› Fixes\n\n- Fix grammar and consistency in french translation (#546)\n- fix typo\n- Distinguish translations of 'Release/Publish'\n- fix translation typo for message (#567)\n\n## ๐Ÿ“ฆ Other\n\n- new thi.ng links and descriptions\n- add link to git-changelog-command-line docker image\n- Add descriptions for commit types` + ) }) diff --git a/__tests__/transformNested.test.ts b/__tests__/transformNested.test.ts index c5985109..0e2d695f 100644 --- a/__tests__/transformNested.test.ts +++ b/__tests__/transformNested.test.ts @@ -81,5 +81,7 @@ it('Match multiple labels exhaustive for category', async () => { ] const built = buildChangelogTest(customConfig, pullRequestsWithLabels, repositoryUtils) - expect(built).toStrictEqual(`## Core\n\n- Core Ticket\n\n### ๐Ÿš€ Features\n\n- Core Feature Ticket\n- Mobile & Core Feature Ticket\n\n### ๐Ÿงช Bug\n\n- Core Bug Ticket\n- Mobile & Core Bug Ticket\n\n#### ๐Ÿงช Bug Bug\n\n- Mobile & Core Bug Bug Ticket\n\n## Mobile\n\n\n### ๐Ÿš€ Features\n\n- Mobile Feature Ticket\n\n### ๐Ÿงช Bug\n\n- Mobile Bug Ticket\n\n`) + expect(built).toStrictEqual( + `## Core\n\n- Core Ticket\n\n### ๐Ÿš€ Features\n\n- Core Feature Ticket\n- Mobile & Core Feature Ticket\n\n### ๐Ÿงช Bug\n\n- Core Bug Ticket\n- Mobile & Core Bug Ticket\n\n#### ๐Ÿงช Bug Bug\n\n- Mobile & Core Bug Bug Ticket\n\n## Mobile\n\n\n### ๐Ÿš€ Features\n\n- Mobile Feature Ticket\n\n### ๐Ÿงช Bug\n\n- Mobile Bug Ticket\n\n` + ) })