- fix formatting

This commit is contained in:
Mike Penz
2024-03-02 20:24:08 +00:00
committed by GitHub
parent 2389f61d7e
commit fb688cc2f5
3 changed files with 18 additions and 12 deletions
+13 -9
View File
@@ -359,21 +359,23 @@ it('Default configuration with commit mode', async () => {
} }
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, options as ReleaseNotesOptions) const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, options as ReleaseNotesOptions)
console.log(changeLog) 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 () => { it('Default configuration with commit mode and custom placeholder', async () => {
const configuration = Object.assign({}, mergeConfiguration(undefined, undefined, 'COMMIT')) const configuration = Object.assign({}, mergeConfiguration(undefined, undefined, 'COMMIT'))
configuration.pr_template = "- #{{TITLE_ONLY}}" configuration.pr_template = '- #{{TITLE_ONLY}}'
configuration.trim_values = true configuration.trim_values = true
configuration.custom_placeholders = [ configuration.custom_placeholders = [
{ {
"name": "TITLE_ONLY", name: 'TITLE_ONLY',
"source": "TITLE", source: 'TITLE',
"transformer": { transformer: {
"method": "regexr", method: 'regexr',
"pattern": "(\\w+(\\(.+\\))?: ?)?(.+)", pattern: '(\\w+(\\(.+\\))?: ?)?(.+)',
"target": "$3" 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) const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, options as ReleaseNotesOptions)
console.log(changeLog) 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`
)
}) })
+3 -1
View File
@@ -81,5 +81,7 @@ it('Match multiple labels exhaustive for category', async () => {
] ]
const built = buildChangelogTest(customConfig, pullRequestsWithLabels, repositoryUtils) 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`
)
}) })