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 + +`) +})