- recompile dist

This commit is contained in:
Mike Penz
2022-07-30 09:04:48 +02:00
parent 2f418c46e5
commit 4cc48881f7
6 changed files with 150 additions and 221 deletions
+54 -92
View File
@@ -53,9 +53,7 @@ it('Should match generated changelog (unspecified tags)', async () => {
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`
)
expect(changeLog).toStrictEqual(`## 🐛 Fixes\n\n- Stacktrace Data can be an array\n - PR: #39\n\n`)
})
it('Should use empty placeholder', async () => {
@@ -83,10 +81,7 @@ it('Should use empty placeholder', async () => {
})
it('Should fill empty placeholders', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_empty_all_placeholders.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_empty_all_placeholders.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
@@ -112,10 +107,7 @@ it('Should fill empty placeholders', async () => {
})
it('Should fill `template` placeholders', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_empty_all_placeholders.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_empty_all_placeholders.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
@@ -141,10 +133,7 @@ it('Should fill `template` placeholders', async () => {
})
it('Should fill `template` placeholders, ignore', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_empty_all_placeholders.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_empty_all_placeholders.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
@@ -170,10 +159,7 @@ it('Should fill `template` placeholders, ignore', async () => {
})
it('Uncategorized category', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_uncategorized_category.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_uncategorized_category.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
@@ -199,10 +185,7 @@ it('Uncategorized category', async () => {
})
it('Verify commit based changelog', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_commits.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_commits.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
@@ -228,10 +211,7 @@ it('Verify commit based changelog', async () => {
})
it('Verify commit based changelog, with emoji categorisation', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_commits_emoji.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_commits_emoji.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
@@ -257,25 +237,22 @@ it('Verify commit based changelog, with emoji categorisation', async () => {
})
it('Verify default inclusion of open PRs', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_including_open.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_including_open.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null, // baseUrl
null, // token
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'1.5.0', // fromTag
'2.0.0', // toTag
true, // includeOpen
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'1.5.0', // fromTag
'2.0.0', // toTag
true, // includeOpen
false, // failOnError
false, // ignorePrePrelease
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // commitMode
configuration // configuration
configuration // configuration
)
const changeLog = await releaseNotesBuilder.build()
@@ -286,25 +263,22 @@ it('Verify default inclusion of open PRs', async () => {
})
it('Verify custom categorisation of open PRs', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_excluding_open.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_excluding_open.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null, // baseUrl
null, // token
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'1.5.0', // fromTag
'2.0.0', // toTag
true, // includeOpen
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'1.5.0', // fromTag
'2.0.0', // toTag
true, // includeOpen
false, // failOnError
false, // ignorePrePrelease
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // commitMode
configuration // configuration
configuration // configuration
)
const changeLog = await releaseNotesBuilder.build()
@@ -315,25 +289,22 @@ it('Verify custom categorisation of open PRs', async () => {
})
it('Verify reviewers who approved are fetched and also release information', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_approvers.json'
)
const configuration = resolveConfiguration('', 'configs_test/configuration_approvers.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null, // baseUrl
null, // token
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'1.5.0', // fromTag
'2.0.0', // toTag
true, // includeOpen
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'1.5.0', // fromTag
'2.0.0', // toTag
true, // includeOpen
false, // failOnError
false, // ignorePrePrelease
true, // enable to fetch reviewers
true, // enable to fetch reviewers
true, // enable to fetch tag release information
false, // commitMode
configuration // configuration
configuration // configuration
)
const changeLog = await releaseNotesBuilder.build()
@@ -343,61 +314,52 @@ it('Verify reviewers who approved are fetched and also release information', asy
)
})
it('Fetch release information', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_approvers.json'
)
configuration.template = "${{FROM_TAG}}-${{FROM_TAG_DATE}}\n${{TO_TAG}}-${{TO_TAG_DATE}}\n${{DAYS_SINCE}}"
const configuration = resolveConfiguration('', 'configs_test/configuration_approvers.json')
configuration.template = '${{FROM_TAG}}-${{FROM_TAG_DATE}}\n${{TO_TAG}}-${{TO_TAG_DATE}}\n${{DAYS_SINCE}}'
const releaseNotesBuilder = new ReleaseNotesBuilder(
null, // baseUrl
null, // token
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'2.0.0', // fromTag
'3.0.0-a01', // toTag
true, // includeOpen
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'2.0.0', // fromTag
'3.0.0-a01', // toTag
true, // includeOpen
false, // failOnError
false, // ignorePrePrelease
false, // enable to fetch reviewers
false, // enable to fetch reviewers
true, // enable to fetch tag release information
false, // commitMode
configuration // configuration
configuration // configuration
)
const changeLog = await releaseNotesBuilder.build()
console.log(changeLog)
expect(changeLog).toStrictEqual(
`2.0.0-2022-04-08T07:52:40.000Z\n3.0.0-a01-2022-07-26T14:28:36.000Z\n109`
)
expect(changeLog).toStrictEqual(`2.0.0-2022-04-08T07:52:40.000Z\n3.0.0-a01-2022-07-26T14:28:36.000Z\n109`)
})
it('Fetch release information for non existing tag / release', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_approvers.json'
)
configuration.template = "${{FROM_TAG}}-${{FROM_TAG_DATE}}\n${{TO_TAG}}-${{TO_TAG_DATE}}\n${{DAYS_SINCE}}"
const configuration = resolveConfiguration('', 'configs_test/configuration_approvers.json')
configuration.template = '${{FROM_TAG}}-${{FROM_TAG_DATE}}\n${{TO_TAG}}-${{TO_TAG_DATE}}\n${{DAYS_SINCE}}'
const releaseNotesBuilder = new ReleaseNotesBuilder(
null, // baseUrl
null, // token
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'2.0.0', // fromTag
'3.0.1', // toTag
true, // includeOpen
'.', // repoPath
'mikepenz', // user
'release-changelog-builder-action-playground', // repo
'2.0.0', // fromTag
'3.0.1', // toTag
true, // includeOpen
false, // failOnError
false, // ignorePrePrelease
false, // enable to fetch reviewers
false, // enable to fetch reviewers
true, // enable to fetch tag release information
false, // commitMode
configuration // configuration
configuration // configuration
)
const changeLog = await releaseNotesBuilder.build()
console.log(changeLog)
expect(changeLog).toStrictEqual(`- no changes`)
})
})