/
platform.spec.ts
50 lines (45 loc) · 2 KB
/
platform.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { BitBucketTagsDatasource } from '../datasource/bitbucket-tags';
import { id as GH_RELEASES_DS } from '../datasource/github-releases';
import { id as GH_TAGS_DS } from '../datasource/github-tags';
import { GitlabPackagesDatasource } from '../datasource/gitlab-packages';
import { GitlabReleasesDatasource } from '../datasource/gitlab-releases';
import { id as GL_TAGS_DS } from '../datasource/gitlab-tags';
import { id as POD_DS } from '../datasource/pod';
import {
BITBUCKET_API_USING_HOST_TYPES,
GITHUB_API_USING_HOST_TYPES,
GITLAB_API_USING_HOST_TYPES,
PlatformId,
} from './platforms';
describe('constants/platform', () => {
it('should be part of the GITLAB_API_USING_HOST_TYPES', () => {
expect(GITLAB_API_USING_HOST_TYPES.includes(GL_TAGS_DS)).toBeTrue();
expect(
GITLAB_API_USING_HOST_TYPES.includes(GitlabReleasesDatasource.id)
).toBeTrue();
expect(
GITLAB_API_USING_HOST_TYPES.includes(GitlabPackagesDatasource.id)
).toBeTrue();
expect(GITLAB_API_USING_HOST_TYPES.includes(PlatformId.Gitlab)).toBeTrue();
});
it('should be not part of the GITLAB_API_USING_HOST_TYPES ', () => {
expect(GITLAB_API_USING_HOST_TYPES.includes(PlatformId.Github)).toBeFalse();
});
it('should be part of the GITHUB_API_USING_HOST_TYPES ', () => {
expect(GITHUB_API_USING_HOST_TYPES.includes(GH_TAGS_DS)).toBeTrue();
expect(GITHUB_API_USING_HOST_TYPES.includes(GH_RELEASES_DS)).toBeTrue();
expect(GITHUB_API_USING_HOST_TYPES.includes(POD_DS)).toBeTrue();
expect(GITHUB_API_USING_HOST_TYPES.includes(PlatformId.Github)).toBeTrue();
});
it('should be not part of the GITHUB_API_USING_HOST_TYPES ', () => {
expect(GITHUB_API_USING_HOST_TYPES.includes(PlatformId.Gitlab)).toBeFalse();
});
it('should be part of the BITBUCKET_API_USING_HOST_TYPES ', () => {
expect(
BITBUCKET_API_USING_HOST_TYPES.includes(BitBucketTagsDatasource.id)
).toBeTrue();
expect(
BITBUCKET_API_USING_HOST_TYPES.includes(PlatformId.Bitbucket)
).toBeTrue();
});
});