From f1be8d021b5f426ce6d47e250e3b6b807775fef0 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 16 Oct 2020 20:34:40 +0200 Subject: [PATCH] - add tests to verify specific from, to - add test to verify specific from, to hashes --- __tests__/main.test.ts | 48 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index b782d87..b522ce3 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -22,7 +22,30 @@ test('test runs', () => { }) */ -it('Should be true', async () => { +it('Should match generated changelog (tags)', async () => { + jest.setTimeout(180000) + + const configuration = readConfiguration('configuration.json') + const releaseNotes = new ReleaseNotes({ + owner: 'mikepenz', + repo: 'release-changelog-builder-action', + fromTag: 'v0.0.1', + toTag: 'v0.0.3', + ignorePreReleases: false, + configuration: configuration + }) + + const changeLog = await releaseNotes.pull() + console.log(changeLog) + expect(changeLog).toStrictEqual(`## 🧪 Tests + +- [CI] Specify Test Case + - PR: #10 + +`) +}) + +it('Should match generated changelog (unspecified fromTag)', async () => { jest.setTimeout(180000) const configuration = readConfiguration('configuration.json') @@ -44,3 +67,26 @@ it('Should be true', async () => { `) }) + +it('Should match generated changelog (refs)', async () => { + jest.setTimeout(180000) + + const configuration = readConfiguration('configuration.json') + const releaseNotes = new ReleaseNotes({ + owner: 'mikepenz', + repo: 'release-changelog-builder-action', + fromTag: '5ec7a2d86fe9f43fdd38d5e254a1117c8a51b4c3', + toTag: 'fa3788c8c4b3373ef8424ce3eb008a5cd07cc5aa', + ignorePreReleases: false, + configuration: configuration + }) + + const changeLog = await releaseNotes.pull() + console.log(changeLog) + expect(changeLog).toStrictEqual(`## 🧪 Tests + +- [CI] Specify Test Case + - PR: #10 + +`) +})