- rework toTag resolving fallback if build was not started from a tag

- fallback to retrieve `toTag` from git API (only if 2 tags are available)
  - FIX https://github.com/mikepenz/release-changelog-builder-action/issues/427
  - FIX https://github.com/mikepenz/release-changelog-builder-action/issues/433
- introduce test case to verify
This commit is contained in:
Mike Penz
2021-08-15 10:56:55 +02:00
parent 8433cedbc5
commit d22595ba8b
6 changed files with 238 additions and 108 deletions
+20
View File
@@ -28,6 +28,26 @@ it('Should match generated changelog (unspecified fromTag)', async () => {
`)
})
it('Should match generated changelog (unspecified tags)', async () => {
const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
'.',
'mikepenz',
'action-junit-report-legacy',
null,
null,
false,
false,
false,
configuration
)
const changeLog = await releaseNotesBuilder.build()
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🐛 Fixes\n\n- Stacktrace Data can be an array\n - PR: #39\n\n`)
})
it('Should use empty placeholder', async () => {
const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(