1
1
beforeEach ( ( ) => {
2
2
process . env [ "GITHUB_REPOSITORY" ] = "marocchino/stick-pull-request-comment"
3
- process . env [ "INPUT_BASE_URL" ] = "https://api.github.com"
4
3
process . env [ "INPUT_NUMBER" ] = "123"
5
4
process . env [ "INPUT_APPEND" ] = "false"
6
5
process . env [ "INPUT_RECREATE" ] = "false"
@@ -19,7 +18,6 @@ beforeEach(() => {
19
18
afterEach ( ( ) => {
20
19
jest . resetModules ( )
21
20
delete process . env [ "GITHUB_REPOSITORY" ]
22
- delete process . env [ "INPUT_BASE_URL" ]
23
21
delete process . env [ "INPUT_OWNER" ]
24
22
delete process . env [ "INPUT_REPO" ]
25
23
delete process . env [ "INPUT_HEADER" ]
@@ -40,29 +38,10 @@ afterEach(() => {
40
38
delete process . env [ "INPUT_FOLLOW_SYMBOLIC_LINKS" ]
41
39
} )
42
40
43
- test ( "baseUrl" , async ( ) => {
44
- process . env [ "INPUT_BASE_URL" ] = "https://repo.yourcompany.com"
45
- expect ( require ( "../src/config" ) ) . toMatchObject ( {
46
- baseUrl : "https://repo.yourcompany.com" ,
47
- pullRequestNumber : expect . any ( Number ) ,
48
- repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
49
- header : "" ,
50
- append : false ,
51
- recreate : false ,
52
- deleteOldComment : false ,
53
- hideOldComment : false ,
54
- hideAndRecreate : false ,
55
- hideClassify : "OUTDATED" ,
56
- hideDetails : false ,
57
- githubToken : "some-token" ,
58
- ignoreEmpty : false
59
- } )
60
- } )
61
41
test ( "repo" , async ( ) => {
62
42
process . env [ "INPUT_OWNER" ] = "jin"
63
43
process . env [ "INPUT_REPO" ] = "other"
64
44
expect ( require ( "../src/config" ) ) . toMatchObject ( {
65
- baseUrl : "https://api.github.com" ,
66
45
pullRequestNumber : expect . any ( Number ) ,
67
46
repo : { owner : "jin" , repo : "other" } ,
68
47
header : "" ,
@@ -81,7 +60,6 @@ test("repo", async () => {
81
60
test ( "header" , async ( ) => {
82
61
process . env [ "INPUT_HEADER" ] = "header"
83
62
expect ( require ( "../src/config" ) ) . toMatchObject ( {
84
- baseUrl : "https://api.github.com" ,
85
63
pullRequestNumber : expect . any ( Number ) ,
86
64
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
87
65
header : "header" ,
@@ -100,7 +78,6 @@ test("header", async () => {
100
78
test ( "append" , async ( ) => {
101
79
process . env [ "INPUT_APPEND" ] = "true"
102
80
expect ( require ( "../src/config" ) ) . toMatchObject ( {
103
- baseUrl : "https://api.github.com" ,
104
81
pullRequestNumber : expect . any ( Number ) ,
105
82
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
106
83
header : "" ,
@@ -119,7 +96,6 @@ test("append", async () => {
119
96
test ( "recreate" , async ( ) => {
120
97
process . env [ "INPUT_RECREATE" ] = "true"
121
98
expect ( require ( "../src/config" ) ) . toMatchObject ( {
122
- baseUrl : "https://api.github.com" ,
123
99
pullRequestNumber : expect . any ( Number ) ,
124
100
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
125
101
header : "" ,
@@ -138,7 +114,6 @@ test("recreate", async () => {
138
114
test ( "delete" , async ( ) => {
139
115
process . env [ "INPUT_DELETE" ] = "true"
140
116
expect ( require ( "../src/config" ) ) . toMatchObject ( {
141
- baseUrl : "https://api.github.com" ,
142
117
pullRequestNumber : expect . any ( Number ) ,
143
118
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
144
119
header : "" ,
@@ -157,7 +132,6 @@ test("delete", async () => {
157
132
test ( "hideOldComment" , async ( ) => {
158
133
process . env [ "INPUT_HIDE" ] = "true"
159
134
expect ( require ( "../src/config" ) ) . toMatchObject ( {
160
- baseUrl : "https://api.github.com" ,
161
135
pullRequestNumber : expect . any ( Number ) ,
162
136
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
163
137
header : "" ,
@@ -176,7 +150,6 @@ test("hideOldComment", async () => {
176
150
test ( "hideAndRecreate" , async ( ) => {
177
151
process . env [ "INPUT_HIDE_AND_RECREATE" ] = "true"
178
152
expect ( require ( "../src/config" ) ) . toMatchObject ( {
179
- baseUrl : "https://api.github.com" ,
180
153
pullRequestNumber : expect . any ( Number ) ,
181
154
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
182
155
header : "" ,
@@ -195,7 +168,6 @@ test("hideAndRecreate", async () => {
195
168
test ( "hideClassify" , async ( ) => {
196
169
process . env [ "INPUT_HIDE_CLASSIFY" ] = "OFF_TOPIC"
197
170
expect ( require ( "../src/config" ) ) . toMatchObject ( {
198
- baseUrl : "https://api.github.com" ,
199
171
pullRequestNumber : expect . any ( Number ) ,
200
172
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
201
173
header : "" ,
@@ -214,7 +186,6 @@ test("hideClassify", async () => {
214
186
test ( "hideDetails" , async ( ) => {
215
187
process . env [ "INPUT_HIDE_DETAILS" ] = "true"
216
188
expect ( require ( "../src/config" ) ) . toMatchObject ( {
217
- baseUrl : "https://api.github.com" ,
218
189
pullRequestNumber : expect . any ( Number ) ,
219
190
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
220
191
header : "" ,
@@ -234,7 +205,6 @@ describe("path", () => {
234
205
test ( "when exists return content of a file" , async ( ) => {
235
206
process . env [ "INPUT_PATH" ] = "./__tests__/assets/result"
236
207
expect ( require ( "../src/config" ) ) . toMatchObject ( {
237
- baseUrl : "https://api.github.com" ,
238
208
pullRequestNumber : expect . any ( Number ) ,
239
209
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
240
210
header : "" ,
@@ -254,7 +224,6 @@ describe("path", () => {
254
224
test ( "glob match files" , async ( ) => {
255
225
process . env [ "INPUT_PATH" ] = "./__tests__/assets/*"
256
226
expect ( require ( "../src/config" ) ) . toMatchObject ( {
257
- baseUrl : "https://api.github.com" ,
258
227
pullRequestNumber : expect . any ( Number ) ,
259
228
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
260
229
header : "" ,
@@ -276,7 +245,6 @@ describe("path", () => {
276
245
test ( "when not exists return null string" , async ( ) => {
277
246
process . env [ "INPUT_PATH" ] = "./__tests__/assets/not_exists"
278
247
expect ( require ( "../src/config" ) ) . toMatchObject ( {
279
- baseUrl : "https://api.github.com" ,
280
248
pullRequestNumber : expect . any ( Number ) ,
281
249
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
282
250
header : "" ,
@@ -297,7 +265,6 @@ describe("path", () => {
297
265
test ( "message" , async ( ) => {
298
266
process . env [ "INPUT_MESSAGE" ] = "hello there"
299
267
expect ( require ( "../src/config" ) ) . toMatchObject ( {
300
- baseUrl : "https://api.github.com" ,
301
268
pullRequestNumber : expect . any ( Number ) ,
302
269
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
303
270
header : "" ,
@@ -317,7 +284,6 @@ test("message", async () => {
317
284
test ( "ignore_empty" , async ( ) => {
318
285
process . env [ "INPUT_IGNORE_EMPTY" ] = "true"
319
286
expect ( require ( "../src/config" ) ) . toMatchObject ( {
320
- baseUrl : "https://api.github.com" ,
321
287
pullRequestNumber : expect . any ( Number ) ,
322
288
repo : { owner : "marocchino" , repo : "stick-pull-request-comment" } ,
323
289
header : "" ,
0 commit comments