diff --git a/__tests__/constants.test.ts b/__tests__/constants.test.ts new file mode 100644 index 0000000..f42d828 --- /dev/null +++ b/__tests__/constants.test.ts @@ -0,0 +1,52 @@ +import { + BRANDING_COMMENT, + BRANDING_WIKI, + GITHUB_ACTIONS_BOT_EMAIL, + GITHUB_ACTIONS_BOT_NAME, + PROJECT_URL, + PR_RELEASE_MARKER, + PR_SUMMARY_MARKER, + WIKI_TITLE_REPLACEMENTS, +} from '../src/constants'; + +describe('constants', () => { + it('should have the correct GitHub Actions bot name', () => { + expect(GITHUB_ACTIONS_BOT_NAME).toBe('GitHub Actions'); + }); + + it('should have the correct GitHub Actions bot email', () => { + expect(GITHUB_ACTIONS_BOT_EMAIL).toBe('41898282+github-actions[bot]@users.noreply.github.com'); + }); + + it('should have the correct PR summary marker', () => { + expect(PR_SUMMARY_MARKER).toBe(''); + }); + + it('should have the correct PR release marker', () => { + expect(PR_RELEASE_MARKER).toBe(''); + }); + + it('should have the correct project URL', () => { + expect(PROJECT_URL).toBe('https://github.com/techpivot/terraform-module-releaser'); + }); + + it('should have the correct branding comment HTML', () => { + const expectedBrandingComment = `

Powered by techpivot/terraform-module-releaser

`; + expect(BRANDING_COMMENT).toBe(expectedBrandingComment); + }); + + it('should have the correct branding wiki HTML', () => { + const expectedBrandingWiki = `

Powered by techpivot/terraform-module-releaser

`; + expect(BRANDING_WIKI).toBe(expectedBrandingWiki); + }); + + describe('WIKI_TITLE_REPLACEMENTS', () => { + it('should replace forward slash with division slash', () => { + expect(WIKI_TITLE_REPLACEMENTS['/']).toBe('∕'); + }); + + it('should replace hyphen with figure dash', () => { + expect(WIKI_TITLE_REPLACEMENTS['-']).toBe('‒'); + }); + }); +}); diff --git a/assets/coverage-badge.svg b/assets/coverage-badge.svg index 7d4e6ce..dcf76fd 100644 --- a/assets/coverage-badge.svg +++ b/assets/coverage-badge.svg @@ -1 +1 @@ -Coverage: 9.16%Coverage9.16% \ No newline at end of file +Coverage: 10.2%Coverage10.2% \ No newline at end of file