- introduce test cases verifying ordering works

This commit is contained in:
Mike Penz
2020-10-18 09:27:20 +02:00
parent d1f245b0eb
commit 3070fb0a7c
4 changed files with 45 additions and 1 deletions
+37 -1
View File
@@ -81,7 +81,7 @@ it('Should match generated changelog (unspecified fromTag)', async () => {
it('Should match generated changelog (refs)', async () => { it('Should match generated changelog (refs)', async () => {
jest.setTimeout(180000) jest.setTimeout(180000)
const configuration = readConfiguration('configs/configuration_all_placeholders.json')!! const configuration = readConfiguration('configs_test/configuration_all_placeholders.json')!!
const releaseNotes = new ReleaseNotes({ const releaseNotes = new ReleaseNotes({
owner: 'mikepenz', owner: 'mikepenz',
repo: 'release-changelog-builder-action', repo: 'release-changelog-builder-action',
@@ -108,3 +108,39 @@ nhoelzl
`) `)
}) })
it('Should match ordered ASC', async () => {
jest.setTimeout(180000)
const configuration = readConfiguration('configs_test/configuration_asc.json')!!
const releaseNotes = new ReleaseNotes({
owner: 'mikepenz',
repo: 'release-changelog-builder-action',
fromTag: 'v0.3.0',
toTag: 'v0.5.0',
ignorePreReleases: false,
configuration: configuration
})
const changeLog = await releaseNotes.pull()
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🚀 Features\n\n22\n24\n25\n26\n28\n\n## 🐛 Fixes\n\n23\n\n`)
})
it('Should match ordered DESC', async () => {
jest.setTimeout(180000)
const configuration = readConfiguration('configs_test/configuration_desc.json')!!
const releaseNotes = new ReleaseNotes({
owner: 'mikepenz',
repo: 'release-changelog-builder-action',
fromTag: 'v0.3.0',
toTag: 'v0.5.0',
ignorePreReleases: false,
configuration: configuration
})
const changeLog = await releaseNotes.pull()
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🚀 Features\n\n28\n26\n25\n24\n22\n\n## 🐛 Fixes\n\n23\n\n`)
})
+4
View File
@@ -0,0 +1,4 @@
{
"sort": "ASC",
"pr_template": "${{NUMBER}}"
}
+4
View File
@@ -0,0 +1,4 @@
{
"sort": "DESC",
"pr_template": "${{NUMBER}}"
}