Implement commit_template

This commit is contained in:
Bob Loblaw
2025-01-31 20:10:11 +01:00
committed by Mike Penz
parent 623490aa2a
commit b8fa364bab
7 changed files with 794 additions and 14 deletions
+45 -3
View File
@@ -15,8 +15,50 @@ it('Configurations are merged correctly', async () => {
const mergedConfiguration = mergeConfiguration(configurationJson, configurationFile)
console.log(mergedConfiguration)
expect(JSON.stringify(mergedConfiguration)).toEqual(
`{\"max_tags_to_fetch\":200,\"max_pull_requests\":1000,\"max_back_track_time_days\":1000,\"exclude_merge_branches\":[],\"sort\":\"DESC\",\"template\":\"#\{\{CHANGELOG}}\",\"pr_template\":\"- #\{\{TITLE}}\\n - PR: ##\{\{NUMBER}}\",\"empty_template\":\"- no magic changes\",\"categories\":[{\"title\":\"## 🚀 Features\",\"labels\":[\"feature\"]},{\"title\":\"## 🐛 Fixes\",\"labels\":[\"fix\"]},{\"title\":\"## 🧪 Tests\",\"labels\":[\"test\"]}],\"ignore_labels\":[\"ignore\"],\"label_extractor\":[],\"transformers\":[],\"tag_resolver\":{\"method\":\"semver\"},\"base_branches\":[],\"custom_placeholders\":[],\"trim_values\":true}`
const expectedStringified = JSON.stringify(mergedConfiguration, null, 2)
expect(expectedStringified).toEqual(
`{
"max_tags_to_fetch": 200,
"max_pull_requests": 1000,
"max_back_track_time_days": 1000,
"exclude_merge_branches": [],
"sort": "DESC",
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}}\\n - PR: ##{{NUMBER}}",
"commit_template": "- #{{TITLE}}",
"empty_template": "- no magic changes",
"categories": [
{
"title": "## 🚀 Features",
"labels": [
"feature"
]
},
{
"title": "## 🐛 Fixes",
"labels": [
"fix"
]
},
{
"title": "## 🧪 Tests",
"labels": [
"test"
]
}
],
"ignore_labels": [
"ignore"
],
"label_extractor": [],
"transformers": [],
"tag_resolver": {
"method": "semver"
},
"base_branches": [],
"custom_placeholders": [],
"trim_values": true
}`
)
})