Skip to content

Commit

Permalink
- fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz authored Mar 2, 2024
1 parent 2389f61 commit fb688cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion __tests__/gitea/releaseNotesBuilderPullGitea.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 14 additions & 10 deletions __tests__/releaseNotesBuilderPull.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'
}
}
]
Expand Down Expand Up @@ -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`
)
})
4 changes: 3 additions & 1 deletion __tests__/transformNested.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
})

0 comments on commit fb688cc

Please sign in to comment.