- make sortTags method to be accessible for test

- add test to verify ordering of tags
This commit is contained in:
Mike Penz
2020-10-19 18:56:26 +02:00
parent a774c0328f
commit c309b839db
2 changed files with 43 additions and 19 deletions
+24
View File
@@ -0,0 +1,24 @@
import { resolveConfiguration } from '../src/utils';
import { ReleaseNotesBuilder } from '../src/releaseNotesBuilder';
import { TagInfo, sortTags } from '../src/tags';
it('Should order tags correctly', async () => {
jest.setTimeout(180000)
const tags: TagInfo[] = [
{ name: "2020.4.0", commit: "" },
{ name: "2020.4.0-rc02", commit: "" },
{ name: "2020.3.2", commit: "" },
{ name: "v2020.3.1", commit: "" },
{ name: "2020.3.1-rc03", commit: "" },
{ name: "2020.3.1-rc01", commit: "" },
{ name: "2020.3.1-b01", commit: "" },
{ name: "v2020.3.0", commit: "" }
]
const sorted = sortTags(tags).map(function (tag) {
return tag.name
}).join(",")
expect(sorted).toStrictEqual(`2020.4.0,2020.4.0-rc02,2020.3.2,v2020.3.1,2020.3.1-rc03,2020.3.1-rc01,2020.3.1-b01,v2020.3.0`)
})