Skip to content

Commit

Permalink
- sample showcase test for transform feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Nov 6, 2021
1 parent 4d00b3e commit d5c72c2
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
24 changes: 24 additions & 0 deletions __tests__/fronius.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {resolveConfiguration} from '../src/utils'
import {ReleaseNotesBuilder} from '../src/releaseNotesBuilder'

jest.setTimeout(180000)

it('Should properly generate changelog', async () => {
const configuration = resolveConfiguration('', 'configs_test/configuration_fronius.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
'.',
'ccremer',
'charts',
null,
'fronius-stack-0.2.0',
false,
true,
false,
configuration
)

const changeLog = await releaseNotesBuilder.build()
console.log(changeLog)
expect(changeLog).toStrictEqual(`1 changes since fronius-stack-0.1.2\n\n## 📄 Documentation\n\n- [fronius-stack] Bogus change to test changelog generator (#93)\n\n`)
})
61 changes: 61 additions & 0 deletions configs_test/configuration_fronius.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
"categories": [
{
"title": "## 🚀 Features",
"labels": [
"enhancement",
"feature"
]
},
{
"title": "## 🛠️ Minor Changes",
"labels": [
"change"
]
},
{
"title": "## 🔎 Breaking Changes",
"labels": [
"breaking"
]
},
{
"title": "## 🐛 Fixes",
"labels": [
"bug",
"fix"
]
},
{
"title": "## 📄 Documentation",
"labels": [
"documentation"
]
},
{
"title": "## 🔗 Dependency Updates",
"labels": [
"dependency"
]
}
],
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}",
"label_extractor": [
{
"pattern": "^(?!\\[fronius-stack\\])",
"method": "replace",
"target": "ignore",
"on_property": "title"
}
],
"tag_resolver": {
"filter": {
"pattern": "fronius-stack-(.+)"
},
"transformer": {
"pattern": "fronius-stack-(.+)",
"target": "$1"
}
}
}

0 comments on commit d5c72c2

Please sign in to comment.