- adjust test cases and provide new flag

This commit is contained in:
Mike Penz
2020-10-18 11:16:04 +02:00
parent 883149d5f3
commit 63430c1e77
+14 -8
View File
@@ -1,5 +1,5 @@
import {ReleaseNotes} from '../src/releaseNotes' import {ReleaseNotes} from '../src/releaseNotes'
import {readConfiguration} from '../src/utils' import { resolveConfiguration } from '../src/utils';
// shows how the runner will run a javascript action with env / stdout protocol // shows how the runner will run a javascript action with env / stdout protocol
/* /*
@@ -17,31 +17,33 @@ test('test runs', () => {
it('Should have empty changelog (tags)', async () => { it('Should have empty changelog (tags)', async () => {
jest.setTimeout(180000) jest.setTimeout(180000)
const configuration = readConfiguration('configs/configuration.json')!! const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotes = new ReleaseNotes({ const releaseNotes = new ReleaseNotes({
owner: 'mikepenz', owner: 'mikepenz',
repo: 'release-changelog-builder-action', repo: 'release-changelog-builder-action',
fromTag: 'v0.0.1', fromTag: 'v0.0.1',
toTag: 'v0.0.2', toTag: 'v0.0.2',
ignorePreReleases: false, ignorePreReleases: false,
failOnError: false,
configuration: configuration configuration: configuration
}) })
const changeLog = await releaseNotes.pull() const changeLog = await releaseNotes.pull()
console.log(changeLog) console.log(changeLog)
expect(changeLog).toStrictEqual(`- no changes`) expect(changeLog).toStrictEqual(null)
}) })
it('Should match generated changelog (tags)', async () => { it('Should match generated changelog (tags)', async () => {
jest.setTimeout(180000) jest.setTimeout(180000)
const configuration = readConfiguration('configs/configuration.json')!! const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotes = new ReleaseNotes({ const releaseNotes = new ReleaseNotes({
owner: 'mikepenz', owner: 'mikepenz',
repo: 'release-changelog-builder-action', repo: 'release-changelog-builder-action',
fromTag: 'v0.0.1', fromTag: 'v0.0.1',
toTag: 'v0.0.3', toTag: 'v0.0.3',
ignorePreReleases: false, ignorePreReleases: false,
failOnError: false,
configuration: configuration configuration: configuration
}) })
@@ -58,13 +60,14 @@ it('Should match generated changelog (tags)', async () => {
it('Should match generated changelog (unspecified fromTag)', async () => { it('Should match generated changelog (unspecified fromTag)', async () => {
jest.setTimeout(180000) jest.setTimeout(180000)
const configuration = readConfiguration('configs/configuration.json')!! const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotes = new ReleaseNotes({ const releaseNotes = new ReleaseNotes({
owner: 'mikepenz', owner: 'mikepenz',
repo: 'release-changelog-builder-action', repo: 'release-changelog-builder-action',
fromTag: null, fromTag: null,
toTag: 'v0.0.3', toTag: 'v0.0.3',
ignorePreReleases: false, ignorePreReleases: false,
failOnError: false,
configuration: configuration configuration: configuration
}) })
@@ -81,13 +84,14 @@ 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_test/configuration_all_placeholders.json')!! const configuration = resolveConfiguration('', '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',
fromTag: '5ec7a2d86fe9f43fdd38d5e254a1117c8a51b4c3', fromTag: '5ec7a2d86fe9f43fdd38d5e254a1117c8a51b4c3',
toTag: 'fa3788c8c4b3373ef8424ce3eb008a5cd07cc5aa', toTag: 'fa3788c8c4b3373ef8424ce3eb008a5cd07cc5aa',
ignorePreReleases: false, ignorePreReleases: false,
failOnError: false,
configuration: configuration configuration: configuration
}) })
@@ -112,13 +116,14 @@ nhoelzl
it('Should match ordered ASC', async () => { it('Should match ordered ASC', async () => {
jest.setTimeout(180000) jest.setTimeout(180000)
const configuration = readConfiguration('configs_test/configuration_asc.json')!! const configuration = resolveConfiguration('', 'configs_test/configuration_asc.json')
const releaseNotes = new ReleaseNotes({ const releaseNotes = new ReleaseNotes({
owner: 'mikepenz', owner: 'mikepenz',
repo: 'release-changelog-builder-action', repo: 'release-changelog-builder-action',
fromTag: 'v0.3.0', fromTag: 'v0.3.0',
toTag: 'v0.5.0', toTag: 'v0.5.0',
ignorePreReleases: false, ignorePreReleases: false,
failOnError: false,
configuration: configuration configuration: configuration
}) })
@@ -130,13 +135,14 @@ it('Should match ordered ASC', async () => {
it('Should match ordered DESC', async () => { it('Should match ordered DESC', async () => {
jest.setTimeout(180000) jest.setTimeout(180000)
const configuration = readConfiguration('configs_test/configuration_desc.json')!! const configuration = resolveConfiguration('', 'configs_test/configuration_desc.json')
const releaseNotes = new ReleaseNotes({ const releaseNotes = new ReleaseNotes({
owner: 'mikepenz', owner: 'mikepenz',
repo: 'release-changelog-builder-action', repo: 'release-changelog-builder-action',
fromTag: 'v0.3.0', fromTag: 'v0.3.0',
toTag: 'v0.5.0', toTag: 'v0.5.0',
ignorePreReleases: false, ignorePreReleases: false,
failOnError: false,
configuration: configuration configuration: configuration
}) })