/
index.spec.ts
128 lines (102 loc) · 3.17 KB
/
index.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import * as platform from './index';
describe('modules/platform/local/index', () => {
describe('initPlatform', () => {
it('returns input', async () => {
expect(await platform.initPlatform({})).toMatchInlineSnapshot(`
{
"dryRun": "lookup",
"endpoint": "local",
"persistRepoData": true,
"requireConfig": "optional",
}
`);
});
});
describe('getRepos', () => {
it('returns empty array', async () => {
expect(await platform.getRepos()).toEqual([]);
});
});
describe('initRepo', () => {
it('returns object', async () => {
expect(await platform.initRepo()).toMatchInlineSnapshot(`
{
"defaultBranch": "",
"isFork": false,
"repoFingerprint": "",
}
`);
});
});
describe('dummy functions', () => {
it('getRepoForceRebase', async () => {
expect(await platform.getRepoForceRebase()).toBe(false);
});
it('findIssue', async () => {
expect(await platform.findIssue()).toBeNull();
});
it('getIssueList', async () => {
expect(await platform.getIssueList()).toEqual([]);
});
it('getRawFile', async () => {
expect(await platform.getRawFile()).toBeNull();
});
it('getJsonFile', async () => {
expect(await platform.getJsonFile()).toBeNull();
});
it('getPrList', async () => {
expect(await platform.getPrList()).toEqual([]);
});
it('ensureIssueClosing', async () => {
expect(await platform.ensureIssueClosing()).toBeUndefined();
});
it('ensureIssue', async () => {
expect(await platform.ensureIssue()).toBeNull();
});
it('massageMarkdown', () => {
expect(platform.massageMarkdown('foo')).toBe('foo');
});
it('updatePr', async () => {
expect(await platform.updatePr()).toBeUndefined();
});
it('mergePr', async () => {
expect(await platform.mergePr()).toBe(false);
});
it('addReviewers', async () => {
expect(await platform.addReviewers()).toBeUndefined();
});
it('addAssignees', async () => {
expect(await platform.addAssignees()).toBeUndefined();
});
it('createPr', async () => {
expect(await platform.createPr()).toBeNull();
});
it('deleteLabel', async () => {
expect(await platform.deleteLabel()).toBeUndefined();
});
it('setBranchStatus', async () => {
expect(await platform.setBranchStatus()).toBeUndefined();
});
it('getBranchStatus', async () => {
expect(await platform.getBranchStatus()).toBe('red');
});
it('getBranchStatusCheck', async () => {
expect(await platform.getBranchStatusCheck()).toBeNull();
});
it('ensureCommentRemoval', async () => {
expect(await platform.ensureCommentRemoval()).toBeUndefined();
});
it('ensureComment', async () => {
expect(await platform.ensureComment()).toBeFalse();
});
it('getPr', async () => {
expect(await platform.getPr()).toBeNull();
});
it('findPr', async () => {
expect(await platform.findPr()).toBeNull();
});
it('getBranchPr', async () => {
expect(await platform.getBranchPr()).toBeNull();
});
});
});