2023-03-17 06:13:37 -06:00
|
|
|
import { BitbucketTagsDatasource } from '../modules/datasource/bitbucket-tags';
|
2023-08-25 08:12:36 -06:00
|
|
|
import { GiteaTagsDatasource } from '../modules/datasource/gitea-tags';
|
2022-03-03 02:35:26 -07:00
|
|
|
import { GithubReleasesDatasource } from '../modules/datasource/github-releases';
|
|
|
|
import { GithubTagsDatasource } from '../modules/datasource/github-tags';
|
|
|
|
import { GitlabPackagesDatasource } from '../modules/datasource/gitlab-packages';
|
|
|
|
import { GitlabReleasesDatasource } from '../modules/datasource/gitlab-releases';
|
|
|
|
import { GitlabTagsDatasource } from '../modules/datasource/gitlab-tags';
|
2022-07-15 03:57:05 -06:00
|
|
|
import { HermitDatasource } from '../modules/datasource/hermit';
|
2022-03-03 02:35:26 -07:00
|
|
|
import { PodDatasource } from '../modules/datasource/pod';
|
2022-03-03 02:53:23 -07:00
|
|
|
import { id as GITHUB_CHANGELOG_ID } from '../workers/repository/update/pr/changelog/github';
|
|
|
|
import { id as GITLAB_CHANGELOG_ID } from '../workers/repository/update/pr/changelog/gitlab';
|
2021-09-06 13:07:52 -06:00
|
|
|
import {
|
2022-01-20 13:16:17 -07:00
|
|
|
BITBUCKET_API_USING_HOST_TYPES,
|
2023-08-25 08:12:36 -06:00
|
|
|
GITEA_API_USING_HOST_TYPES,
|
2021-09-06 13:07:52 -06:00
|
|
|
GITHUB_API_USING_HOST_TYPES,
|
|
|
|
GITLAB_API_USING_HOST_TYPES,
|
|
|
|
} from './platforms';
|
|
|
|
|
|
|
|
describe('constants/platform', () => {
|
2023-08-25 08:12:36 -06:00
|
|
|
it('should be part of the GITEA_API_USING_HOST_TYPES', () => {
|
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITEA_API_USING_HOST_TYPES.includes(GiteaTagsDatasource.id),
|
2023-08-25 08:12:36 -06:00
|
|
|
).toBeTrue();
|
|
|
|
expect(GITEA_API_USING_HOST_TYPES.includes('gitea')).toBeTrue();
|
|
|
|
});
|
|
|
|
|
2021-09-06 13:07:52 -06:00
|
|
|
it('should be part of the GITLAB_API_USING_HOST_TYPES', () => {
|
2022-02-10 22:42:14 -07:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITLAB_API_USING_HOST_TYPES.includes(GitlabTagsDatasource.id),
|
2022-02-10 22:42:14 -07:00
|
|
|
).toBeTrue();
|
2021-09-06 13:07:52 -06:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITLAB_API_USING_HOST_TYPES.includes(GitlabReleasesDatasource.id),
|
2021-09-06 13:07:52 -06:00
|
|
|
).toBeTrue();
|
2021-09-16 04:47:30 -06:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITLAB_API_USING_HOST_TYPES.includes(GitlabPackagesDatasource.id),
|
2021-09-16 04:47:30 -06:00
|
|
|
).toBeTrue();
|
2022-02-02 03:20:51 -07:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITLAB_API_USING_HOST_TYPES.includes(GITLAB_CHANGELOG_ID),
|
2022-02-02 03:20:51 -07:00
|
|
|
).toBeTrue();
|
2022-11-01 08:46:09 -06:00
|
|
|
expect(GITLAB_API_USING_HOST_TYPES.includes('gitlab')).toBeTrue();
|
2021-09-06 13:07:52 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should be not part of the GITLAB_API_USING_HOST_TYPES ', () => {
|
2022-11-01 08:46:09 -06:00
|
|
|
expect(GITLAB_API_USING_HOST_TYPES.includes('github')).toBeFalse();
|
2021-09-06 13:07:52 -06:00
|
|
|
});
|
2021-08-25 01:07:23 -06:00
|
|
|
|
|
|
|
it('should be part of the GITHUB_API_USING_HOST_TYPES ', () => {
|
2022-02-12 20:24:40 -07:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITHUB_API_USING_HOST_TYPES.includes(GithubTagsDatasource.id),
|
2022-02-12 20:24:40 -07:00
|
|
|
).toBeTrue();
|
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITHUB_API_USING_HOST_TYPES.includes(GithubReleasesDatasource.id),
|
2022-02-12 20:24:40 -07:00
|
|
|
).toBeTrue();
|
2022-02-10 13:07:16 -07:00
|
|
|
expect(GITHUB_API_USING_HOST_TYPES.includes(PodDatasource.id)).toBeTrue();
|
2022-07-15 03:57:05 -06:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITHUB_API_USING_HOST_TYPES.includes(HermitDatasource.id),
|
2022-07-15 03:57:05 -06:00
|
|
|
).toBeTrue();
|
2022-02-02 03:20:51 -07:00
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
GITHUB_API_USING_HOST_TYPES.includes(GITHUB_CHANGELOG_ID),
|
2022-02-02 03:20:51 -07:00
|
|
|
).toBeTrue();
|
2022-11-01 08:46:09 -06:00
|
|
|
expect(GITHUB_API_USING_HOST_TYPES.includes('github')).toBeTrue();
|
2021-08-25 01:07:23 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should be not part of the GITHUB_API_USING_HOST_TYPES ', () => {
|
2022-11-01 08:46:09 -06:00
|
|
|
expect(GITHUB_API_USING_HOST_TYPES.includes('gitlab')).toBeFalse();
|
2021-08-25 01:07:23 -06:00
|
|
|
});
|
2022-01-20 13:16:17 -07:00
|
|
|
|
|
|
|
it('should be part of the BITBUCKET_API_USING_HOST_TYPES ', () => {
|
|
|
|
expect(
|
2023-11-07 08:50:29 -07:00
|
|
|
BITBUCKET_API_USING_HOST_TYPES.includes(BitbucketTagsDatasource.id),
|
2022-01-20 13:16:17 -07:00
|
|
|
).toBeTrue();
|
2022-11-01 08:46:09 -06:00
|
|
|
expect(BITBUCKET_API_USING_HOST_TYPES.includes('bitbucket')).toBeTrue();
|
2022-01-20 13:16:17 -07:00
|
|
|
});
|
2021-08-25 01:07:23 -06:00
|
|
|
});
|