- add additional test case to highlight combined regex for multiple labels
This commit is contained in:
@@ -164,3 +164,28 @@ it('Extract label from title, match', async () => {
|
|||||||
|
|
||||||
expect(resultChangelog).toStrictEqual(`## 🚀 Features\n\n- [Feature][AB-1234] - this is a PR 1 title message\n - PR: #1\n- [Issue][Feature][AB-1234321] - this is a PR 3 title message\n - PR: #3\n\n## 🐛 Fixes\n\n- [Issue][AB-4321] - this is a PR 2 title message\n - PR: #2\n- [Issue][Feature][AB-1234321] - this is a PR 3 title message\n - PR: #3\n\n`)
|
expect(resultChangelog).toStrictEqual(`## 🚀 Features\n\n- [Feature][AB-1234] - this is a PR 1 title message\n - PR: #1\n- [Issue][Feature][AB-1234321] - this is a PR 3 title message\n - PR: #3\n\n## 🐛 Fixes\n\n- [Issue][AB-4321] - this is a PR 2 title message\n - PR: #2\n- [Issue][Feature][AB-1234321] - this is a PR 3 title message\n - PR: #3\n\n`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Extract label from title, match multiple', async () => {
|
||||||
|
configuration.label_extractor = [
|
||||||
|
{
|
||||||
|
"pattern": "\\[Feature\\]|\\[Issue\\]",
|
||||||
|
"on_property": "title",
|
||||||
|
"method": "match"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const resultChangelog = buildChangelog(
|
||||||
|
mergedPullRequests,
|
||||||
|
{
|
||||||
|
owner: "mikepenz",
|
||||||
|
repo: "test-repo",
|
||||||
|
fromTag: "1.0.0",
|
||||||
|
toTag: "2.0.0",
|
||||||
|
failOnError: false,
|
||||||
|
commitMode: false,
|
||||||
|
configuration: configuration
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(resultChangelog).toStrictEqual(`## 🚀 Features\n\n- [Feature][AB-1234] - this is a PR 1 title message\n - PR: #1\n- [Issue][Feature][AB-1234321] - this is a PR 3 title message\n - PR: #3\n\n## 🐛 Fixes\n\n- [Issue][AB-4321] - this is a PR 2 title message\n - PR: #2\n- [Issue][Feature][AB-1234321] - this is a PR 3 title message\n - PR: #3\n\n`)
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user