f4a36ecba4
no issue
- the link to the release has `-moya` added to it, which breaks the link
to the github release. This ensures it gets removed should it be there
to avoid broken links.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at f13886c</samp>
Refactored the `About.tsx` component to extract some utility functions
to separate modules. Added unit tests for the extracted functions in the
`test/unit/utils` folder. The refactoring improves code organization and
reusability, and the tests increase the code coverage and reliability.
17 lines
635 B
TypeScript
17 lines
635 B
TypeScript
import * as assert from 'assert/strict';
|
|
import {linkToGitHubReleases} from '../../../src/utils/linkToGithubReleases';
|
|
|
|
describe('linkToGithubRelease', function () {
|
|
it('generates a link to a release', function () {
|
|
let version = '5.69.0';
|
|
let link = linkToGitHubReleases(version);
|
|
assert.equal(link, 'https://github.com/TryGhost/Ghost/releases/tag/v5.69.0');
|
|
});
|
|
|
|
it('strips moya from the version', function () {
|
|
let version = '5.69.0+moya';
|
|
let link = linkToGitHubReleases(version);
|
|
assert.equal(link, 'https://github.com/TryGhost/Ghost/releases/tag/v5.69.0');
|
|
});
|
|
});
|