volunteer-contributions-fetch 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +1 -1
- package/.github/workflows/release.yml +2 -2
- package/.github/workflows/test.yml +13 -13
- package/.prettierignore +4 -0
- package/README.md +71 -71
- package/fixtures/community-portal.js +184 -172
- package/lib/bugzilla.js +21 -12
- package/lib/bugzilla.test.js +59 -48
- package/lib/community-portal.js +20 -14
- package/lib/community-portal.test.js +30 -18
- package/lib/discourse.js +7 -6
- package/lib/discourse.test.js +31 -28
- package/lib/fetch.js +25 -14
- package/lib/fetch.test.js +34 -17
- package/lib/github.js +74 -34
- package/lib/github.test.js +526 -403
- package/lib/wiki.js +27 -41
- package/lib/wiki.test.js +11 -10
- package/package.json +16 -8
package/lib/github.test.js
CHANGED
|
@@ -11,7 +11,7 @@ const config = {
|
|
|
11
11
|
stopDate: new Date('2022-01-01'),
|
|
12
12
|
filter: '',
|
|
13
13
|
delayMsPerRequest: 0,
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
test.beforeEach((t) => {
|
|
@@ -83,35 +83,49 @@ test.serial('should not fetch if disabled - by enable property', async (t) => {
|
|
|
83
83
|
t.is(contributions.length, 0);
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
test.serial(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
86
|
+
test.serial(
|
|
87
|
+
'should not fetch if disabled - by leaving off config value',
|
|
88
|
+
async (t) => {
|
|
89
|
+
const contributions = await github.gather({});
|
|
91
90
|
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
t.is(contributions.length, 0);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
test.serial(
|
|
96
|
+
'should throw if private repo scope token is used and config does not allow private repo access',
|
|
97
|
+
async (t) => {
|
|
98
|
+
fetcher.throwIfTokenHasPrivateRepoScope.rejects(new Error('PRIVATE_SCOPE'));
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
await t.throwsAsync(() => github.gather(config));
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
test.serial(
|
|
105
|
+
'should not throw if private repo scope token is used but config does allow private repo access',
|
|
106
|
+
async (t) => {
|
|
107
|
+
fetcher.throwIfTokenHasPrivateRepoScope.rejects(new Error('PRIVATE_SCOPE'));
|
|
108
|
+
const allowedPrivateConfig = {
|
|
109
|
+
github: {
|
|
110
|
+
...config.github,
|
|
111
|
+
allowPrivate: true,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
106
114
|
|
|
107
|
-
|
|
108
|
-
}
|
|
115
|
+
t.notThrows(() => github.gather(allowedPrivateConfig));
|
|
116
|
+
}
|
|
117
|
+
);
|
|
109
118
|
|
|
110
|
-
test.serial(
|
|
111
|
-
|
|
119
|
+
test.serial(
|
|
120
|
+
'should throw if error is not specifically private scope error',
|
|
121
|
+
async (t) => {
|
|
122
|
+
fetcher.throwIfTokenHasPrivateRepoScope.rejects(
|
|
123
|
+
new Error('SOMETHING_ELSE')
|
|
124
|
+
);
|
|
112
125
|
|
|
113
|
-
|
|
114
|
-
}
|
|
126
|
+
await t.throwsAsync(() => github.gather(config));
|
|
127
|
+
}
|
|
128
|
+
);
|
|
115
129
|
|
|
116
130
|
test.serial('should fetch commits until stop date', async (t) => {
|
|
117
131
|
const commitConfig = {
|
|
@@ -125,9 +139,21 @@ test.serial('should fetch commits until stop date', async (t) => {
|
|
|
125
139
|
// We want to fetch 2 pages for the first period, and one page for the subsequent periods.
|
|
126
140
|
// We expect 3 periods to be queried based on the passed stopDate and the faked clock.
|
|
127
141
|
fetcher.searchCommits.resolves([]);
|
|
128
|
-
fetcher.searchCommits
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
fetcher.searchCommits
|
|
143
|
+
.onCall(0)
|
|
144
|
+
.resolves(
|
|
145
|
+
new Array(100).fill(0).map(() => ({ createdAt: new Date('2022-03-01') }))
|
|
146
|
+
);
|
|
147
|
+
fetcher.searchCommits
|
|
148
|
+
.onCall(1)
|
|
149
|
+
.resolves(
|
|
150
|
+
new Array(5).fill(0).map(() => ({ createdAt: new Date('2022-02-01') }))
|
|
151
|
+
);
|
|
152
|
+
fetcher.searchCommits
|
|
153
|
+
.onCall(2)
|
|
154
|
+
.resolves(
|
|
155
|
+
new Array(5).fill(0).map(() => ({ createdAt: new Date('2022-01-01') }))
|
|
156
|
+
);
|
|
131
157
|
|
|
132
158
|
await github.gather(commitConfig);
|
|
133
159
|
t.deepEqual(fetcher.searchCommits.getCall(0).args[0], {
|
|
@@ -179,22 +205,24 @@ test.serial('should format commits', async (t) => {
|
|
|
179
205
|
},
|
|
180
206
|
};
|
|
181
207
|
|
|
182
|
-
fetcher.searchCommits.onCall(0).resolves([
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
208
|
+
fetcher.searchCommits.onCall(0).resolves([
|
|
209
|
+
{
|
|
210
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
211
|
+
commit: {
|
|
212
|
+
author: {
|
|
213
|
+
date: new Date('2022-03-02'),
|
|
214
|
+
},
|
|
215
|
+
message: 'Test Commit Message',
|
|
216
|
+
},
|
|
217
|
+
repository: {
|
|
218
|
+
private: false,
|
|
219
|
+
name: 'foo',
|
|
220
|
+
owner: {
|
|
221
|
+
login: 'contribution-test',
|
|
222
|
+
},
|
|
187
223
|
},
|
|
188
|
-
message: 'Test Commit Message',
|
|
189
|
-
},
|
|
190
|
-
repository: {
|
|
191
|
-
private: false,
|
|
192
|
-
name: 'foo',
|
|
193
|
-
owner: {
|
|
194
|
-
login: 'contribution-test',
|
|
195
|
-
}
|
|
196
224
|
},
|
|
197
|
-
|
|
225
|
+
]);
|
|
198
226
|
|
|
199
227
|
const result = await github.gather(commitConfig);
|
|
200
228
|
t.is(result.length, 1);
|
|
@@ -221,22 +249,24 @@ test.serial('should format commits with custom type', async (t) => {
|
|
|
221
249
|
},
|
|
222
250
|
};
|
|
223
251
|
|
|
224
|
-
fetcher.searchCommits.onCall(0).resolves([
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
252
|
+
fetcher.searchCommits.onCall(0).resolves([
|
|
253
|
+
{
|
|
254
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
255
|
+
commit: {
|
|
256
|
+
author: {
|
|
257
|
+
date: new Date('2022-03-02'),
|
|
258
|
+
},
|
|
259
|
+
message: 'Test Commit Message',
|
|
260
|
+
},
|
|
261
|
+
repository: {
|
|
262
|
+
private: false,
|
|
263
|
+
name: 'foo',
|
|
264
|
+
owner: {
|
|
265
|
+
login: 'contribution-test',
|
|
266
|
+
},
|
|
229
267
|
},
|
|
230
|
-
message: 'Test Commit Message',
|
|
231
|
-
},
|
|
232
|
-
repository: {
|
|
233
|
-
private: false,
|
|
234
|
-
name: 'foo',
|
|
235
|
-
owner: {
|
|
236
|
-
login: 'contribution-test',
|
|
237
|
-
}
|
|
238
268
|
},
|
|
239
|
-
|
|
269
|
+
]);
|
|
240
270
|
|
|
241
271
|
const result = await github.gather(commitConfig);
|
|
242
272
|
t.is(result.length, 1);
|
|
@@ -254,22 +284,24 @@ test.serial('should format private commit', async (t) => {
|
|
|
254
284
|
},
|
|
255
285
|
};
|
|
256
286
|
|
|
257
|
-
fetcher.searchCommits.onCall(0).resolves([
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
287
|
+
fetcher.searchCommits.onCall(0).resolves([
|
|
288
|
+
{
|
|
289
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
290
|
+
commit: {
|
|
291
|
+
author: {
|
|
292
|
+
date: new Date('2022-03-02'),
|
|
293
|
+
},
|
|
294
|
+
message: 'Test Commit Message',
|
|
295
|
+
},
|
|
296
|
+
repository: {
|
|
297
|
+
private: true,
|
|
298
|
+
name: 'foo',
|
|
299
|
+
owner: {
|
|
300
|
+
login: 'contribution-test',
|
|
301
|
+
},
|
|
262
302
|
},
|
|
263
|
-
message: 'Test Commit Message',
|
|
264
|
-
},
|
|
265
|
-
repository: {
|
|
266
|
-
private: true,
|
|
267
|
-
name: 'foo',
|
|
268
|
-
owner: {
|
|
269
|
-
login: 'contribution-test',
|
|
270
|
-
}
|
|
271
303
|
},
|
|
272
|
-
|
|
304
|
+
]);
|
|
273
305
|
|
|
274
306
|
const result = await github.gather(commitConfig);
|
|
275
307
|
t.is(result.length, 1);
|
|
@@ -287,23 +319,25 @@ test.serial('should ignore commits from before the stopDate', async (t) => {
|
|
|
287
319
|
},
|
|
288
320
|
};
|
|
289
321
|
|
|
290
|
-
fetcher.searchCommits.onCall(0).resolves([
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
322
|
+
fetcher.searchCommits.onCall(0).resolves([
|
|
323
|
+
{
|
|
324
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
325
|
+
commit: {
|
|
326
|
+
author: {
|
|
327
|
+
// Old commit
|
|
328
|
+
date: new Date('1999-03-02'),
|
|
329
|
+
},
|
|
330
|
+
message: 'Test Commit Message',
|
|
331
|
+
},
|
|
332
|
+
repository: {
|
|
333
|
+
private: false,
|
|
334
|
+
name: 'foo',
|
|
335
|
+
owner: {
|
|
336
|
+
login: 'contribution-test',
|
|
337
|
+
},
|
|
296
338
|
},
|
|
297
|
-
message: 'Test Commit Message',
|
|
298
|
-
},
|
|
299
|
-
repository: {
|
|
300
|
-
private: false,
|
|
301
|
-
name: 'foo',
|
|
302
|
-
owner: {
|
|
303
|
-
login: 'contribution-test',
|
|
304
|
-
}
|
|
305
339
|
},
|
|
306
|
-
|
|
340
|
+
]);
|
|
307
341
|
|
|
308
342
|
const result = await github.gather(commitConfig);
|
|
309
343
|
t.is(result.length, 0);
|
|
@@ -320,22 +354,24 @@ test.serial('should ignore commits not matching filter', async (t) => {
|
|
|
320
354
|
},
|
|
321
355
|
};
|
|
322
356
|
|
|
323
|
-
fetcher.searchCommits.onCall(0).resolves([
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
357
|
+
fetcher.searchCommits.onCall(0).resolves([
|
|
358
|
+
{
|
|
359
|
+
html_url: 'https://github.com/not-going-to-match-filter/foo',
|
|
360
|
+
commit: {
|
|
361
|
+
author: {
|
|
362
|
+
date: new Date('2022-03-02'),
|
|
363
|
+
},
|
|
364
|
+
message: 'Test Commit Message',
|
|
365
|
+
},
|
|
366
|
+
repository: {
|
|
367
|
+
private: false,
|
|
368
|
+
name: 'foo',
|
|
369
|
+
owner: {
|
|
370
|
+
login: 'contribution-test',
|
|
371
|
+
},
|
|
328
372
|
},
|
|
329
|
-
message: 'Test Commit Message',
|
|
330
|
-
},
|
|
331
|
-
repository: {
|
|
332
|
-
private: false,
|
|
333
|
-
name: 'foo',
|
|
334
|
-
owner: {
|
|
335
|
-
login: 'contribution-test',
|
|
336
|
-
}
|
|
337
373
|
},
|
|
338
|
-
|
|
374
|
+
]);
|
|
339
375
|
|
|
340
376
|
const result = await github.gather(commitConfig);
|
|
341
377
|
t.is(result.length, 0);
|
|
@@ -353,9 +389,21 @@ test.serial('should fetch issues until stop date', async (t) => {
|
|
|
353
389
|
// We want to fetch 2 pages for the first period, and one page for the subsequent periods.
|
|
354
390
|
// We expect 3 periods to be queried based on the passed stopDate and the faked clock.
|
|
355
391
|
fetcher.searchIssues.resolves([]);
|
|
356
|
-
fetcher.searchIssues
|
|
357
|
-
|
|
358
|
-
|
|
392
|
+
fetcher.searchIssues
|
|
393
|
+
.onCall(0)
|
|
394
|
+
.resolves(
|
|
395
|
+
new Array(100).fill(0).map(() => ({ createdAt: new Date('2022-03-01') }))
|
|
396
|
+
);
|
|
397
|
+
fetcher.searchIssues
|
|
398
|
+
.onCall(1)
|
|
399
|
+
.resolves(
|
|
400
|
+
new Array(5).fill(0).map(() => ({ createdAt: new Date('2022-02-01') }))
|
|
401
|
+
);
|
|
402
|
+
fetcher.searchIssues
|
|
403
|
+
.onCall(2)
|
|
404
|
+
.resolves(
|
|
405
|
+
new Array(5).fill(0).map(() => ({ createdAt: new Date('2022-01-01') }))
|
|
406
|
+
);
|
|
359
407
|
|
|
360
408
|
await github.gather(commitConfig);
|
|
361
409
|
t.deepEqual(fetcher.searchIssues.getCall(0).args[0], {
|
|
@@ -407,11 +455,13 @@ test.serial('should format issues', async (t) => {
|
|
|
407
455
|
},
|
|
408
456
|
};
|
|
409
457
|
|
|
410
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
458
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
459
|
+
{
|
|
460
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
461
|
+
created_at: new Date('2022-03-02'),
|
|
462
|
+
title: 'IssueA',
|
|
463
|
+
},
|
|
464
|
+
]);
|
|
415
465
|
|
|
416
466
|
const result = await github.gather(commitConfig);
|
|
417
467
|
t.is(result.length, 1);
|
|
@@ -438,11 +488,13 @@ test.serial('should format issues with custom type', async (t) => {
|
|
|
438
488
|
},
|
|
439
489
|
};
|
|
440
490
|
|
|
441
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
491
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
492
|
+
{
|
|
493
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
494
|
+
created_at: new Date('2022-03-02'),
|
|
495
|
+
title: 'IssueA',
|
|
496
|
+
},
|
|
497
|
+
]);
|
|
446
498
|
|
|
447
499
|
const result = await github.gather(commitConfig);
|
|
448
500
|
t.is(result.length, 1);
|
|
@@ -460,14 +512,16 @@ test.serial('should format issues (PR)', async (t) => {
|
|
|
460
512
|
},
|
|
461
513
|
};
|
|
462
514
|
|
|
463
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
515
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
516
|
+
{
|
|
517
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
518
|
+
created_at: new Date('2022-03-02'),
|
|
519
|
+
title: 'PR',
|
|
520
|
+
pull_request: {
|
|
521
|
+
url: 'https://api.github.com/some-pr-url',
|
|
522
|
+
},
|
|
469
523
|
},
|
|
470
|
-
|
|
524
|
+
]);
|
|
471
525
|
|
|
472
526
|
const result = await github.gather(commitConfig);
|
|
473
527
|
t.is(result.length, 1);
|
|
@@ -494,14 +548,16 @@ test.serial('should format issues (PR) with custom type', async (t) => {
|
|
|
494
548
|
},
|
|
495
549
|
};
|
|
496
550
|
|
|
497
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
551
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
552
|
+
{
|
|
553
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
554
|
+
created_at: new Date('2022-03-02'),
|
|
555
|
+
title: 'PR',
|
|
556
|
+
pull_request: {
|
|
557
|
+
url: 'https://api.github.com/some-pr-url',
|
|
558
|
+
},
|
|
503
559
|
},
|
|
504
|
-
|
|
560
|
+
]);
|
|
505
561
|
|
|
506
562
|
const result = await github.gather(commitConfig);
|
|
507
563
|
t.is(result.length, 1);
|
|
@@ -519,12 +575,14 @@ test.serial('should ignore issues from before the stopDate', async (t) => {
|
|
|
519
575
|
},
|
|
520
576
|
};
|
|
521
577
|
|
|
522
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
578
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
579
|
+
{
|
|
580
|
+
html_url: 'https://github.com/contribution-test/foo',
|
|
581
|
+
// Old issue
|
|
582
|
+
created_at: new Date('1999-01-01'),
|
|
583
|
+
title: 'IssueA',
|
|
584
|
+
},
|
|
585
|
+
]);
|
|
528
586
|
|
|
529
587
|
const result = await github.gather(commitConfig);
|
|
530
588
|
t.is(result.length, 0);
|
|
@@ -541,11 +599,13 @@ test.serial('should ignore issues not matching filter', async (t) => {
|
|
|
541
599
|
},
|
|
542
600
|
};
|
|
543
601
|
|
|
544
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
602
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
603
|
+
{
|
|
604
|
+
html_url: 'https://github.com/not-going-to-match-filter/foo',
|
|
605
|
+
created_at: new Date('2022-03-02'),
|
|
606
|
+
title: 'IssueA',
|
|
607
|
+
},
|
|
608
|
+
]);
|
|
549
609
|
|
|
550
610
|
const result = await github.gather(commitConfig);
|
|
551
611
|
t.is(result.length, 0);
|
|
@@ -563,38 +623,46 @@ test.serial('should fetch reviews until stop date', async (t) => {
|
|
|
563
623
|
// We want to fetch 2 pages for the first period, and one page for the subsequent periods.
|
|
564
624
|
// We expect 3 periods to be queried based on the passed stopDate and the faked clock.
|
|
565
625
|
fetcher.searchIssues.resolves([]);
|
|
566
|
-
fetcher.searchIssues.onCall(0).resolves(
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
626
|
+
fetcher.searchIssues.onCall(0).resolves(
|
|
627
|
+
new Array(100).fill(0).map(() => ({
|
|
628
|
+
createdAt: new Date('2022-03-01'),
|
|
629
|
+
repository_url: 'https://api.github.com/repos/contributions-test/foo',
|
|
630
|
+
number: 1111, // This would be dynamic, but fine enough for this test
|
|
631
|
+
pull_request: {
|
|
632
|
+
url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
633
|
+
},
|
|
634
|
+
}))
|
|
635
|
+
);
|
|
636
|
+
fetcher.searchIssues.onCall(1).resolves(
|
|
637
|
+
new Array(5).fill(0).map(() => ({
|
|
638
|
+
createdAt: new Date('2022-02-01'),
|
|
639
|
+
repository_url: 'https://api.github.com/repos/contributions-test/foo',
|
|
640
|
+
number: 1111,
|
|
641
|
+
pull_request: {
|
|
642
|
+
url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
643
|
+
},
|
|
644
|
+
}))
|
|
645
|
+
);
|
|
646
|
+
fetcher.searchIssues.onCall(2).resolves(
|
|
647
|
+
new Array(5).fill(0).map(() => ({
|
|
648
|
+
createdAt: new Date('2022-01-01'),
|
|
649
|
+
repository_url: 'https://api.github.com/repos/contributions-test/foo',
|
|
650
|
+
number: 1111,
|
|
651
|
+
pull_request: {
|
|
652
|
+
url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
653
|
+
},
|
|
654
|
+
}))
|
|
655
|
+
);
|
|
590
656
|
|
|
591
657
|
fetcher.listReviews.resolves([]);
|
|
592
|
-
fetcher.listReviews.onCall(0).resolves([
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
658
|
+
fetcher.listReviews.onCall(0).resolves([
|
|
659
|
+
{
|
|
660
|
+
createdAt: new Date('2022-03-01'),
|
|
661
|
+
user: {
|
|
662
|
+
login: commitConfig.github.username,
|
|
663
|
+
},
|
|
596
664
|
},
|
|
597
|
-
|
|
665
|
+
]);
|
|
598
666
|
|
|
599
667
|
await github.gather(commitConfig);
|
|
600
668
|
t.deepEqual(fetcher.searchIssues.getCall(0).args[0], {
|
|
@@ -652,42 +720,48 @@ test.serial('should format reviews', async (t) => {
|
|
|
652
720
|
},
|
|
653
721
|
};
|
|
654
722
|
|
|
655
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
723
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
724
|
+
{
|
|
725
|
+
createdAt: new Date('2022-03-02'),
|
|
726
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
727
|
+
html_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
728
|
+
title: 'Some PR',
|
|
729
|
+
number: 1111,
|
|
730
|
+
pull_request: {
|
|
731
|
+
url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
732
|
+
},
|
|
733
|
+
},
|
|
734
|
+
]);
|
|
735
|
+
|
|
736
|
+
fetcher.listReviews.onCall(0).resolves([
|
|
737
|
+
{
|
|
738
|
+
submitted_at: new Date('2022-03-02'),
|
|
739
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
740
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
741
|
+
state: 'CHANGES_REQUESTED',
|
|
742
|
+
user: {
|
|
743
|
+
login: commitConfig.github.username,
|
|
744
|
+
},
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
submitted_at: new Date('2022-03-02'),
|
|
748
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
749
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
750
|
+
state: 'COMMENTED',
|
|
751
|
+
user: {
|
|
752
|
+
login: commitConfig.github.username,
|
|
753
|
+
},
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
submitted_at: new Date('2022-03-02'),
|
|
757
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
758
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
759
|
+
state: 'APPROVED',
|
|
760
|
+
user: {
|
|
761
|
+
login: commitConfig.github.username,
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
]);
|
|
691
765
|
|
|
692
766
|
const result = await github.gather(commitConfig);
|
|
693
767
|
t.is(result.length, 3);
|
|
@@ -726,46 +800,52 @@ test.serial('should custom format reviews', async (t) => {
|
|
|
726
800
|
commentedPR: 'COMMENT!',
|
|
727
801
|
changesRequestedPR: 'CHANGE!',
|
|
728
802
|
approvedPR: 'APPROVE!',
|
|
729
|
-
}
|
|
803
|
+
},
|
|
730
804
|
},
|
|
731
805
|
};
|
|
732
806
|
|
|
733
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
807
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
808
|
+
{
|
|
809
|
+
createdAt: new Date('2022-03-02'),
|
|
810
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
811
|
+
html_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
812
|
+
title: 'Some PR',
|
|
813
|
+
number: 1111,
|
|
814
|
+
pull_request: {
|
|
815
|
+
url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
]);
|
|
819
|
+
|
|
820
|
+
fetcher.listReviews.onCall(0).resolves([
|
|
821
|
+
{
|
|
822
|
+
submitted_at: new Date('2022-03-02'),
|
|
823
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
824
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
825
|
+
state: 'CHANGES_REQUESTED',
|
|
826
|
+
user: {
|
|
827
|
+
login: commitConfig.github.username,
|
|
828
|
+
},
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
submitted_at: new Date('2022-03-02'),
|
|
832
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
833
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
834
|
+
state: 'COMMENTED',
|
|
835
|
+
user: {
|
|
836
|
+
login: commitConfig.github.username,
|
|
837
|
+
},
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
submitted_at: new Date('2022-03-02'),
|
|
841
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
842
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
843
|
+
state: 'APPROVED',
|
|
844
|
+
user: {
|
|
845
|
+
login: commitConfig.github.username,
|
|
846
|
+
},
|
|
847
|
+
},
|
|
848
|
+
]);
|
|
769
849
|
|
|
770
850
|
const result = await github.gather(commitConfig);
|
|
771
851
|
t.is(result.length, 3);
|
|
@@ -785,23 +865,27 @@ test.serial('should ignore reviews from before the stopDate', async (t) => {
|
|
|
785
865
|
},
|
|
786
866
|
};
|
|
787
867
|
|
|
788
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
868
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
869
|
+
{
|
|
870
|
+
createdAt: new Date('1999-01-01'),
|
|
871
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
872
|
+
html_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
873
|
+
title: 'Some PR',
|
|
874
|
+
number: 1111,
|
|
875
|
+
pull_request: {
|
|
876
|
+
url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
877
|
+
},
|
|
796
878
|
},
|
|
797
|
-
|
|
879
|
+
]);
|
|
798
880
|
|
|
799
|
-
fetcher.listReviews.onCall(0).resolves([
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
881
|
+
fetcher.listReviews.onCall(0).resolves([
|
|
882
|
+
{
|
|
883
|
+
submitted_at: new Date('1999-01-01'),
|
|
884
|
+
pull_request_url: 'https://github.com/contributions-test/foo/pulls/1',
|
|
885
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
886
|
+
state: 'CHANGES_REQUESTED',
|
|
887
|
+
},
|
|
888
|
+
]);
|
|
805
889
|
|
|
806
890
|
const result = await github.gather(commitConfig);
|
|
807
891
|
t.is(result.length, 0);
|
|
@@ -818,23 +902,27 @@ test.serial('should ignore reviews not matching filter', async (t) => {
|
|
|
818
902
|
},
|
|
819
903
|
};
|
|
820
904
|
|
|
821
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
905
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
906
|
+
{
|
|
907
|
+
createdAt: new Date('2022-03-02'),
|
|
908
|
+
repository_url: 'https://api.github.com/repos/not-matching-filter/foo',
|
|
909
|
+
html_url: 'https://api.github.com/repos/not-matching-filter/foo',
|
|
910
|
+
title: 'Some PR',
|
|
911
|
+
number: 1111,
|
|
912
|
+
pull_request: {
|
|
913
|
+
url: 'https://github.com/not-matching-filter/foo/pulls/1',
|
|
914
|
+
},
|
|
915
|
+
},
|
|
916
|
+
]);
|
|
917
|
+
|
|
918
|
+
fetcher.listReviews.onCall(0).resolves([
|
|
919
|
+
{
|
|
920
|
+
submitted_at: new Date('2022-03-01'),
|
|
921
|
+
pull_request_url: 'https://github.com/not-matching-filter/foo/pulls/1',
|
|
922
|
+
html_url: 'https://github.com/not-matching-filter/foo/pulls/1',
|
|
923
|
+
state: 'CHANGES_REQUESTED',
|
|
924
|
+
},
|
|
925
|
+
]);
|
|
838
926
|
|
|
839
927
|
const result = await github.gather(commitConfig);
|
|
840
928
|
t.is(result.length, 0);
|
|
@@ -851,42 +939,48 @@ test.serial('should ignore reviews not by user', async (t) => {
|
|
|
851
939
|
},
|
|
852
940
|
};
|
|
853
941
|
|
|
854
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
942
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
943
|
+
{
|
|
944
|
+
createdAt: new Date('2022-03-02'),
|
|
945
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
946
|
+
html_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
947
|
+
title: 'Some PR',
|
|
948
|
+
number: 1111,
|
|
949
|
+
pull_request: {
|
|
950
|
+
url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
951
|
+
},
|
|
952
|
+
},
|
|
953
|
+
]);
|
|
954
|
+
|
|
955
|
+
fetcher.listReviews.onCall(0).resolves([
|
|
956
|
+
{
|
|
957
|
+
submitted_at: new Date('2022-03-01'),
|
|
958
|
+
pull_request_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
959
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
960
|
+
state: 'CHANGES_REQUESTED',
|
|
961
|
+
user: {
|
|
962
|
+
login: 'not-the-right-user',
|
|
963
|
+
},
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
submitted_at: new Date('2022-03-01'),
|
|
967
|
+
pull_request_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
968
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
969
|
+
state: 'COMMENTED',
|
|
970
|
+
user: {
|
|
971
|
+
login: 'not-the-right-user',
|
|
972
|
+
},
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
submitted_at: new Date('2022-03-01'),
|
|
976
|
+
pull_request_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
977
|
+
html_url: 'https://github.com/contribution-test/foo/pulls/1',
|
|
978
|
+
state: 'CHANGES_REQUESTED',
|
|
979
|
+
user: {
|
|
980
|
+
login: commitConfig.github.username,
|
|
981
|
+
},
|
|
982
|
+
},
|
|
983
|
+
]);
|
|
890
984
|
|
|
891
985
|
const result = await github.gather(commitConfig);
|
|
892
986
|
t.is(result.length, 1);
|
|
@@ -905,32 +999,40 @@ test.serial('should fetch comments until stop date', async (t) => {
|
|
|
905
999
|
// We want to fetch 2 pages for the first period, and one page for the subsequent periods.
|
|
906
1000
|
// We expect 3 periods to be queried based on the passed stopDate and the faked clock.
|
|
907
1001
|
fetcher.searchIssues.resolves([]);
|
|
908
|
-
fetcher.searchIssues.onCall(0).resolves(
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1002
|
+
fetcher.searchIssues.onCall(0).resolves(
|
|
1003
|
+
new Array(100).fill(0).map(() => ({
|
|
1004
|
+
createdAt: new Date('2022-03-01'),
|
|
1005
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1006
|
+
number: 1111, // This would be dynamic, but fine enough for this test
|
|
1007
|
+
title: 'IssueTitle',
|
|
1008
|
+
}))
|
|
1009
|
+
);
|
|
1010
|
+
fetcher.searchIssues.onCall(1).resolves(
|
|
1011
|
+
new Array(5).fill(0).map(() => ({
|
|
1012
|
+
createdAt: new Date('2022-02-01'),
|
|
1013
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1014
|
+
number: 1111,
|
|
1015
|
+
title: 'IssueTitle',
|
|
1016
|
+
}))
|
|
1017
|
+
);
|
|
1018
|
+
fetcher.searchIssues.onCall(2).resolves(
|
|
1019
|
+
new Array(5).fill(0).map(() => ({
|
|
1020
|
+
createdAt: new Date('2022-01-01'),
|
|
1021
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1022
|
+
number: 1111,
|
|
1023
|
+
title: 'IssueTitle',
|
|
1024
|
+
}))
|
|
1025
|
+
);
|
|
926
1026
|
|
|
927
1027
|
fetcher.listComments.resolves([]);
|
|
928
|
-
fetcher.listComments.onCall(0).resolves([
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1028
|
+
fetcher.listComments.onCall(0).resolves([
|
|
1029
|
+
{
|
|
1030
|
+
createdAt: new Date('2022-03-01'),
|
|
1031
|
+
user: {
|
|
1032
|
+
login: config.github.username,
|
|
1033
|
+
},
|
|
932
1034
|
},
|
|
933
|
-
|
|
1035
|
+
]);
|
|
934
1036
|
|
|
935
1037
|
await github.gather(commitConfig);
|
|
936
1038
|
t.deepEqual(fetcher.searchIssues.getCall(0).args[0], {
|
|
@@ -990,23 +1092,28 @@ test.serial('should format comments', async (t) => {
|
|
|
990
1092
|
},
|
|
991
1093
|
};
|
|
992
1094
|
|
|
993
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1095
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
1096
|
+
{
|
|
1097
|
+
createdAt: new Date('2022-03-02'),
|
|
1098
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1099
|
+
url: 'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1100
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1101
|
+
title: 'Some Issue',
|
|
1102
|
+
number: 1111,
|
|
1103
|
+
},
|
|
1104
|
+
]);
|
|
1105
|
+
|
|
1106
|
+
fetcher.listComments.onCall(0).resolves([
|
|
1107
|
+
{
|
|
1108
|
+
created_at: new Date('2022-03-02'),
|
|
1109
|
+
issue_url:
|
|
1110
|
+
'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1111
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1112
|
+
user: {
|
|
1113
|
+
login: config.github.username,
|
|
1114
|
+
},
|
|
1115
|
+
},
|
|
1116
|
+
]);
|
|
1010
1117
|
|
|
1011
1118
|
const result = await github.gather(commitConfig);
|
|
1012
1119
|
t.is(result.length, 1);
|
|
@@ -1034,23 +1141,28 @@ test.serial('should custom format comments', async (t) => {
|
|
|
1034
1141
|
},
|
|
1035
1142
|
};
|
|
1036
1143
|
|
|
1037
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1144
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
1145
|
+
{
|
|
1146
|
+
createdAt: new Date('2022-03-02'),
|
|
1147
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1148
|
+
url: 'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1149
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1150
|
+
title: 'Some Issue',
|
|
1151
|
+
number: 1111,
|
|
1152
|
+
},
|
|
1153
|
+
]);
|
|
1154
|
+
|
|
1155
|
+
fetcher.listComments.onCall(0).resolves([
|
|
1156
|
+
{
|
|
1157
|
+
created_at: new Date('2022-03-02'),
|
|
1158
|
+
issue_url:
|
|
1159
|
+
'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1160
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1161
|
+
user: {
|
|
1162
|
+
login: config.github.username,
|
|
1163
|
+
},
|
|
1164
|
+
},
|
|
1165
|
+
]);
|
|
1054
1166
|
|
|
1055
1167
|
const result = await github.gather(commitConfig);
|
|
1056
1168
|
t.is(result.length, 1);
|
|
@@ -1069,23 +1181,28 @@ test.serial('should ignore comments from before stopDate', async (t) => {
|
|
|
1069
1181
|
},
|
|
1070
1182
|
};
|
|
1071
1183
|
|
|
1072
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1184
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
1185
|
+
{
|
|
1186
|
+
createdAt: new Date('2022-03-02'),
|
|
1187
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1188
|
+
url: 'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1189
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1190
|
+
title: 'Some Issue',
|
|
1191
|
+
number: 1111,
|
|
1192
|
+
},
|
|
1193
|
+
]);
|
|
1194
|
+
|
|
1195
|
+
fetcher.listComments.onCall(0).resolves([
|
|
1196
|
+
{
|
|
1197
|
+
created_at: new Date('1999-01-01'),
|
|
1198
|
+
issue_url:
|
|
1199
|
+
'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1200
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1201
|
+
user: {
|
|
1202
|
+
login: config.github.username,
|
|
1203
|
+
},
|
|
1204
|
+
},
|
|
1205
|
+
]);
|
|
1089
1206
|
|
|
1090
1207
|
const result = await github.gather(commitConfig);
|
|
1091
1208
|
t.is(result.length, 0);
|
|
@@ -1103,32 +1220,38 @@ test.serial('should ignore comments not matching filter', async (t) => {
|
|
|
1103
1220
|
},
|
|
1104
1221
|
};
|
|
1105
1222
|
|
|
1106
|
-
fetcher.searchIssues.onCall(0).resolves([
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1223
|
+
fetcher.searchIssues.onCall(0).resolves([
|
|
1224
|
+
{
|
|
1225
|
+
createdAt: new Date('2022-03-02'),
|
|
1226
|
+
repository_url: 'https://api.github.com/repos/not-matching-filter/foo',
|
|
1227
|
+
url: 'https://api.github.com/repos/not-matching-filter/foo/issues/1111',
|
|
1228
|
+
html_url: 'https://github.com/not-matching-filter/foo/issues/1111',
|
|
1229
|
+
title: 'Some Issue',
|
|
1230
|
+
number: 1111,
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
createdAt: new Date('2022-03-02'),
|
|
1234
|
+
repository_url: 'https://api.github.com/repos/contribution-test/foo',
|
|
1235
|
+
url: 'https://api.github.com/repos/contribution-test/foo/issues/1111',
|
|
1236
|
+
html_url: 'https://github.com/contribution-test/foo/issues/1111',
|
|
1237
|
+
title: 'Some Issue',
|
|
1238
|
+
number: 1111,
|
|
1239
|
+
},
|
|
1240
|
+
]);
|
|
1121
1241
|
|
|
1122
1242
|
// While this is the first call, it will be the call for the second issue
|
|
1123
1243
|
// as we filter out the first issue from above due to not matching,.
|
|
1124
|
-
fetcher.listComments.onCall(0).resolves([
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1244
|
+
fetcher.listComments.onCall(0).resolves([
|
|
1245
|
+
{
|
|
1246
|
+
created_at: new Date('2022-03-02'),
|
|
1247
|
+
issue_url:
|
|
1248
|
+
'https://api.github.com/repos/not-matching-filter/foo/issues/1111',
|
|
1249
|
+
html_url: 'https://github.com/not-matching-filter/foo/issues/1111',
|
|
1250
|
+
user: {
|
|
1251
|
+
login: config.github.username,
|
|
1252
|
+
},
|
|
1253
|
+
},
|
|
1254
|
+
]);
|
|
1132
1255
|
|
|
1133
1256
|
const result = await github.gather(commitConfig);
|
|
1134
1257
|
t.is(result.length, 0);
|