@@ -29,9 +29,8 @@ test("Verify package, token and repository access", async (t) => {
29
29
30
30
const fetch = fetchMock
31
31
. sandbox ( )
32
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
32
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
33
33
permissions : { push : true } ,
34
- clone_url : `git+https://othertesturl.com/${ owner } /${ repo } .git` ,
35
34
} ) ;
36
35
37
36
await t . notThrowsAsync (
@@ -77,9 +76,8 @@ test('Verify package, token and repository access with "proxy", "asset", "discus
77
76
78
77
const fetch = fetchMock
79
78
. sandbox ( )
80
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
79
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
81
80
permissions : { push : true } ,
82
- clone_url : `git+https://othertesturl.com/${ owner } /${ repo } .git` ,
83
81
} ) ;
84
82
85
83
await t . notThrowsAsync (
@@ -120,9 +118,8 @@ test("Verify package, token and repository access and custom URL with prefix", a
120
118
121
119
const fetch = fetchMock
122
120
. sandbox ( )
123
- . get ( `https://othertesturl.com:9090/prefix/repos/${ owner } /${ repo } ` , {
121
+ . getOnce ( `https://othertesturl.com:9090/prefix/repos/${ owner } /${ repo } ` , {
124
122
permissions : { push : true } ,
125
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
126
123
} ) ;
127
124
128
125
await t . notThrowsAsync (
@@ -159,9 +156,8 @@ test("Verify package, token and repository access and custom URL without prefix"
159
156
160
157
const fetch = fetchMock
161
158
. sandbox ( )
162
- . get ( `https://othertesturl.com:9090/repos/${ owner } /${ repo } ` , {
159
+ . getOnce ( `https://othertesturl.com:9090/repos/${ owner } /${ repo } ` , {
163
160
permissions : { push : true } ,
164
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
165
161
} ) ;
166
162
167
163
await t . notThrowsAsync (
@@ -198,9 +194,8 @@ test("Verify package, token and repository access and shorthand repositoryUrl UR
198
194
199
195
const fetch = fetchMock
200
196
. sandbox ( )
201
- . get ( `https://othertesturl.com:9090/repos/${ owner } /${ repo } ` , {
197
+ . getOnce ( `https://othertesturl.com:9090/repos/${ owner } /${ repo } ` , {
202
198
permissions : { push : true } ,
203
- clone_url : `github:${ owner } /${ repo } ` ,
204
199
} ) ;
205
200
206
201
await t . notThrowsAsync (
@@ -238,9 +233,8 @@ test("Verify package, token and repository with environment variables", async (t
238
233
} ;
239
234
const fetch = fetchMock
240
235
. sandbox ( )
241
- . get ( `https://othertesturl.com:443/prefix/repos/${ owner } /${ repo } ` , {
236
+ . getOnce ( `https://othertesturl.com:443/prefix/repos/${ owner } /${ repo } ` , {
242
237
permissions : { push : true } ,
243
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
244
238
} ) ;
245
239
246
240
await t . notThrowsAsync (
@@ -280,9 +274,8 @@ test("Verify package, token and repository access with alternative environment v
280
274
281
275
const fetch = fetchMock
282
276
. sandbox ( )
283
- . get ( `https://othertesturl.com:443/prefix/repos/${ owner } /${ repo } ` , {
277
+ . getOnce ( `https://othertesturl.com:443/prefix/repos/${ owner } /${ repo } ` , {
284
278
permissions : { push : true } ,
285
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
286
279
} ) ;
287
280
288
281
await t . notThrowsAsync (
@@ -315,9 +308,8 @@ test("Verify package, token and repository access with custom API URL", async (t
315
308
316
309
const fetch = fetchMock
317
310
. sandbox ( )
318
- . get ( `https://api.othertesturl.com:9090/repos/${ owner } /${ repo } ` , {
311
+ . getOnce ( `https://api.othertesturl.com:9090/repos/${ owner } /${ repo } ` , {
319
312
permissions : { push : true } ,
320
- clone_url : `github:${ owner } /${ repo } ` ,
321
313
} ) ;
322
314
323
315
await t . notThrowsAsync (
@@ -355,9 +347,8 @@ test("Verify package, token and repository access with API URL in environment va
355
347
356
348
const fetch = fetchMock
357
349
. sandbox ( )
358
- . get ( `https://api.othertesturl.com:443/repos/${ owner } /${ repo } ` , {
350
+ . getOnce ( `https://api.othertesturl.com:443/repos/${ owner } /${ repo } ` , {
359
351
permissions : { push : true } ,
360
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
361
352
} ) ;
362
353
363
354
await t . notThrowsAsync (
@@ -389,9 +380,8 @@ test('Verify "proxy" is a String', async (t) => {
389
380
390
381
const fetch = fetchMock
391
382
. sandbox ( )
392
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
383
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
393
384
permissions : { push : true } ,
394
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
395
385
} ) ;
396
386
397
387
await t . notThrowsAsync (
@@ -422,9 +412,8 @@ test('Verify "proxy" is an object with "host" and "port" properties', async (t)
422
412
423
413
const fetch = fetchMock
424
414
. sandbox ( )
425
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
415
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
426
416
permissions : { push : true } ,
427
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
428
417
} ) ;
429
418
430
419
await t . notThrowsAsync (
@@ -457,9 +446,8 @@ test('Verify "proxy" is a Boolean set to false', async (t) => {
457
446
458
447
const fetch = fetchMock
459
448
. sandbox ( )
460
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
449
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
461
450
permissions : { push : true } ,
462
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
463
451
} ) ;
464
452
465
453
await t . notThrowsAsync (
@@ -490,9 +478,8 @@ test('Verify "assets" is a String', async (t) => {
490
478
491
479
const fetch = fetchMock
492
480
. sandbox ( )
493
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
481
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
494
482
permissions : { push : true } ,
495
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
496
483
} ) ;
497
484
498
485
await t . notThrowsAsync (
@@ -523,9 +510,8 @@ test('Verify "assets" is an Object with a path property', async (t) => {
523
510
524
511
const fetch = fetchMock
525
512
. sandbox ( )
526
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
513
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
527
514
permissions : { push : true } ,
528
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
529
515
} ) ;
530
516
531
517
await t . notThrowsAsync (
@@ -556,9 +542,8 @@ test('Verify "assets" is an Array of Object with a path property', async (t) =>
556
542
557
543
const fetch = fetchMock
558
544
. sandbox ( )
559
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
545
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
560
546
permissions : { push : true } ,
561
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
562
547
} ) ;
563
548
564
549
await t . notThrowsAsync (
@@ -591,9 +576,8 @@ test('Verify "assets" is an Array of glob Arrays', async (t) => {
591
576
592
577
const fetch = fetchMock
593
578
. sandbox ( )
594
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
579
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
595
580
permissions : { push : true } ,
596
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
597
581
} ) ;
598
582
599
583
await t . notThrowsAsync (
@@ -624,9 +608,8 @@ test('Verify "assets" is an Array of Object with a glob Arrays in path property'
624
608
625
609
const fetch = fetchMock
626
610
. sandbox ( )
627
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
611
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
628
612
permissions : { push : true } ,
629
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
630
613
} ) ;
631
614
632
615
await t . notThrowsAsync (
@@ -659,9 +642,8 @@ test('Verify "labels" is a String', async (t) => {
659
642
660
643
const fetch = fetchMock
661
644
. sandbox ( )
662
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
645
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
663
646
permissions : { push : true } ,
664
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
665
647
} ) ;
666
648
667
649
await t . notThrowsAsync (
@@ -692,9 +674,8 @@ test('Verify "assignees" is a String', async (t) => {
692
674
693
675
const fetch = fetchMock
694
676
. sandbox ( )
695
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
677
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
696
678
permissions : { push : true } ,
697
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
698
679
} ) ;
699
680
700
681
await t . notThrowsAsync (
@@ -725,9 +706,8 @@ test('Verify "addReleases" is a valid string (top)', async (t) => {
725
706
726
707
const fetch = fetchMock
727
708
. sandbox ( )
728
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
709
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
729
710
permissions : { push : true } ,
730
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
731
711
} ) ;
732
712
733
713
await t . notThrowsAsync (
@@ -758,9 +738,8 @@ test('Verify "addReleases" is a valid string (bottom)', async (t) => {
758
738
759
739
const fetch = fetchMock
760
740
. sandbox ( )
761
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
741
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
762
742
permissions : { push : true } ,
763
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
764
743
} ) ;
765
744
766
745
await t . notThrowsAsync (
@@ -791,9 +770,8 @@ test('Verify "addReleases" is valid (false)', async (t) => {
791
770
792
771
const fetch = fetchMock
793
772
. sandbox ( )
794
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
773
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
795
774
permissions : { push : true } ,
796
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
797
775
} ) ;
798
776
799
777
await t . notThrowsAsync (
@@ -824,9 +802,8 @@ test('Verify "draftRelease" is valid (true)', async (t) => {
824
802
825
803
const fetch = fetchMock
826
804
. sandbox ( )
827
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
805
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
828
806
permissions : { push : true } ,
829
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
830
807
} ) ;
831
808
832
809
await t . notThrowsAsync (
@@ -857,9 +834,8 @@ test('Verify "draftRelease" is valid (false)', async (t) => {
857
834
858
835
const fetch = fetchMock
859
836
. sandbox ( )
860
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
837
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
861
838
permissions : { push : true } ,
862
- clone_url : `git@othertesturl.com:${ owner } /${ repo } .git` ,
863
839
} ) ;
864
840
865
841
await t . notThrowsAsync (
@@ -898,12 +874,6 @@ test("Verify if run in GitHub Action", async (t) => {
898
874
const labels = [ "semantic-release" ] ;
899
875
const discussionCategoryName = "Announcements" ;
900
876
901
- const fetch = fetchMock
902
- . sandbox ( )
903
- . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
904
- clone_url : `git+https://othertesturl.com/${ owner } /${ repo } .git` ,
905
- } ) ;
906
-
907
877
await t . notThrowsAsync (
908
878
verify (
909
879
{ proxy, assets, successComment, failTitle, failComment, labels } ,
@@ -960,7 +930,9 @@ test("Throw SemanticReleaseError for invalid token", async (t) => {
960
930
. sandbox ( )
961
931
. getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , 401 ) ;
962
932
963
- const errors = await t . throwsAsync (
933
+ const {
934
+ errors : [ error , ...errors ] ,
935
+ } = await t . throwsAsync (
964
936
verify (
965
937
{ } ,
966
938
{
@@ -977,12 +949,10 @@ test("Throw SemanticReleaseError for invalid token", async (t) => {
977
949
) ,
978
950
) ;
979
951
980
- t . log ( errors ) ;
981
-
982
- // t.is(errors.length, 0);
983
- // t.is(error.name, "SemanticReleaseError");
984
- // t.is(error.code, "EINVALIDGHTOKEN");
985
- // t.true(fetch.done());
952
+ t . is ( errors . length , 0 ) ;
953
+ t . is ( error . name , "SemanticReleaseError" ) ;
954
+ t . is ( error . code , "EINVALIDGHTOKEN" ) ;
955
+ t . true ( fetch . done ( ) ) ;
986
956
} ) ;
987
957
988
958
test ( "Throw SemanticReleaseError for invalid repositoryUrl" , async ( t ) => {
@@ -1019,9 +989,8 @@ test("Throw SemanticReleaseError if token doesn't have the push permission on th
1019
989
1020
990
const fetch = fetchMock
1021
991
. sandbox ( )
1022
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
992
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1023
993
permissions : { push : false } ,
1024
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1025
994
} )
1026
995
. headOnce (
1027
996
"https://api.github.local/installation/repositories?per_page=1" ,
@@ -1060,9 +1029,8 @@ test("Do not throw SemanticReleaseError if token doesn't have the push permissio
1060
1029
1061
1030
const fetch = fetchMock
1062
1031
. sandbox ( )
1063
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1032
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1064
1033
permissions : { push : false } ,
1065
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1066
1034
} )
1067
1035
. headOnce (
1068
1036
"https://api.github.local/installation/repositories?per_page=1" ,
@@ -1096,7 +1064,7 @@ test("Throw SemanticReleaseError if the repository doesn't exist", async (t) =>
1096
1064
1097
1065
const fetch = fetchMock
1098
1066
. sandbox ( )
1099
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , 404 ) ;
1067
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , 404 ) ;
1100
1068
1101
1069
const {
1102
1070
errors : [ error , ...errors ] ,
@@ -1123,43 +1091,6 @@ test("Throw SemanticReleaseError if the repository doesn't exist", async (t) =>
1123
1091
t . true ( fetch . done ( ) ) ;
1124
1092
} ) ;
1125
1093
1126
- test ( "Throw SemanticReleaseError if the repository name has been changed" , async ( t ) => {
1127
- const owner = "test_user" ;
1128
- const repo = "test_repo" ;
1129
- const env = { GH_TOKEN : "github_token" } ;
1130
-
1131
- const fetch = fetchMock
1132
- . sandbox ( )
1133
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1134
- permissions : { push : true } ,
1135
- clone_url : `https://github.com/${ owner } /new-repo-name.git` ,
1136
- } ) ;
1137
-
1138
- const {
1139
- errors : [ error , ...errors ] ,
1140
- } = await t . throwsAsync (
1141
- verify (
1142
- { } ,
1143
- {
1144
- env,
1145
- options : { repositoryUrl : `https://github.com/${ owner } /${ repo } .git` } ,
1146
- logger : t . context . logger ,
1147
- } ,
1148
- {
1149
- Octokit : TestOctokit . defaults ( ( options ) => ( {
1150
- ...options ,
1151
- request : { ...options . request , fetch } ,
1152
- } ) ) ,
1153
- } ,
1154
- ) ,
1155
- ) ;
1156
-
1157
- t . is ( errors . length , 0 ) ;
1158
- t . is ( error . name , "SemanticReleaseError" ) ;
1159
- t . is ( error . code , "EMISMATCHGITHUBURL" ) ;
1160
- t . true ( fetch . done ( ) ) ;
1161
- } ) ;
1162
-
1163
1094
test ( "Throw error if github return any other errors" , async ( t ) => {
1164
1095
const owner = "test_user" ;
1165
1096
const repo = "test_repo" ;
@@ -1258,9 +1189,8 @@ test('Throw SemanticReleaseError if "assets" option is not a String or an Array
1258
1189
1259
1190
const fetch = fetchMock
1260
1191
. sandbox ( )
1261
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1192
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1262
1193
permissions : { push : true } ,
1263
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1264
1194
} ) ;
1265
1195
1266
1196
const {
@@ -1296,9 +1226,8 @@ test('Throw SemanticReleaseError if "assets" option is an Array with invalid ele
1296
1226
1297
1227
const fetch = fetchMock
1298
1228
. sandbox ( )
1299
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1229
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1300
1230
permissions : { push : true } ,
1301
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1302
1231
} ) ;
1303
1232
1304
1233
const {
@@ -1334,9 +1263,8 @@ test('Throw SemanticReleaseError if "assets" option is an Object missing the "pa
1334
1263
1335
1264
const fetch = fetchMock
1336
1265
. sandbox ( )
1337
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1266
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1338
1267
permissions : { push : true } ,
1339
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1340
1268
} ) ;
1341
1269
1342
1270
const {
@@ -1372,9 +1300,8 @@ test('Throw SemanticReleaseError if "assets" option is an Array with objects mis
1372
1300
1373
1301
const fetch = fetchMock
1374
1302
. sandbox ( )
1375
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1303
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1376
1304
permissions : { push : true } ,
1377
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1378
1305
} ) ;
1379
1306
1380
1307
const {
@@ -1410,9 +1337,8 @@ test('Throw SemanticReleaseError if "successComment" option is not a String', as
1410
1337
1411
1338
const fetch = fetchMock
1412
1339
. sandbox ( )
1413
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1340
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1414
1341
permissions : { push : true } ,
1415
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1416
1342
} ) ;
1417
1343
1418
1344
const {
@@ -1448,9 +1374,8 @@ test('Throw SemanticReleaseError if "successComment" option is an empty String',
1448
1374
1449
1375
const fetch = fetchMock
1450
1376
. sandbox ( )
1451
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1377
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1452
1378
permissions : { push : true } ,
1453
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1454
1379
} ) ;
1455
1380
1456
1381
const {
@@ -1486,9 +1411,8 @@ test('Throw SemanticReleaseError if "successComment" option is a whitespace Stri
1486
1411
1487
1412
const fetch = fetchMock
1488
1413
. sandbox ( )
1489
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1414
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1490
1415
permissions : { push : true } ,
1491
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1492
1416
} ) ;
1493
1417
1494
1418
const {
@@ -1524,9 +1448,8 @@ test('Throw SemanticReleaseError if "failTitle" option is not a String', async (
1524
1448
1525
1449
const fetch = fetchMock
1526
1450
. sandbox ( )
1527
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1451
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1528
1452
permissions : { push : true } ,
1529
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1530
1453
} ) ;
1531
1454
1532
1455
const {
@@ -1562,9 +1485,8 @@ test('Throw SemanticReleaseError if "failTitle" option is an empty String', asyn
1562
1485
1563
1486
const fetch = fetchMock
1564
1487
. sandbox ( )
1565
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1488
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1566
1489
permissions : { push : true } ,
1567
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1568
1490
} ) ;
1569
1491
1570
1492
const {
@@ -1600,9 +1522,8 @@ test('Throw SemanticReleaseError if "failTitle" option is a whitespace String',
1600
1522
1601
1523
const fetch = fetchMock
1602
1524
. sandbox ( )
1603
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1525
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1604
1526
permissions : { push : true } ,
1605
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1606
1527
} ) ;
1607
1528
1608
1529
const {
@@ -1638,9 +1559,8 @@ test('Throw SemanticReleaseError if "discussionCategoryName" option is not a Str
1638
1559
1639
1560
const fetch = fetchMock
1640
1561
. sandbox ( )
1641
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1562
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1642
1563
permissions : { push : true } ,
1643
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1644
1564
} ) ;
1645
1565
1646
1566
const {
@@ -1676,9 +1596,8 @@ test('Throw SemanticReleaseError if "discussionCategoryName" option is an empty
1676
1596
1677
1597
const fetch = fetchMock
1678
1598
. sandbox ( )
1679
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1599
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1680
1600
permissions : { push : true } ,
1681
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1682
1601
} ) ;
1683
1602
1684
1603
const {
@@ -1714,9 +1633,8 @@ test('Throw SemanticReleaseError if "discussionCategoryName" option is a whitesp
1714
1633
1715
1634
const fetch = fetchMock
1716
1635
. sandbox ( )
1717
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1636
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1718
1637
permissions : { push : true } ,
1719
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1720
1638
} ) ;
1721
1639
1722
1640
const {
@@ -1752,9 +1670,8 @@ test('Throw SemanticReleaseError if "failComment" option is not a String', async
1752
1670
1753
1671
const fetch = fetchMock
1754
1672
. sandbox ( )
1755
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1673
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1756
1674
permissions : { push : true } ,
1757
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1758
1675
} ) ;
1759
1676
1760
1677
const {
@@ -1790,9 +1707,8 @@ test('Throw SemanticReleaseError if "failComment" option is an empty String', as
1790
1707
1791
1708
const fetch = fetchMock
1792
1709
. sandbox ( )
1793
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1710
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1794
1711
permissions : { push : true } ,
1795
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1796
1712
} ) ;
1797
1713
1798
1714
const {
@@ -1828,9 +1744,8 @@ test('Throw SemanticReleaseError if "failComment" option is a whitespace String'
1828
1744
1829
1745
const fetch = fetchMock
1830
1746
. sandbox ( )
1831
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1747
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1832
1748
permissions : { push : true } ,
1833
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1834
1749
} ) ;
1835
1750
1836
1751
const {
@@ -1866,9 +1781,8 @@ test('Throw SemanticReleaseError if "labels" option is not a String or an Array
1866
1781
1867
1782
const fetch = fetchMock
1868
1783
. sandbox ( )
1869
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1784
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1870
1785
permissions : { push : true } ,
1871
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1872
1786
} ) ;
1873
1787
1874
1788
const {
@@ -1904,9 +1818,8 @@ test('Throw SemanticReleaseError if "labels" option is an Array with invalid ele
1904
1818
1905
1819
const fetch = fetchMock
1906
1820
. sandbox ( )
1907
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1821
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1908
1822
permissions : { push : true } ,
1909
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1910
1823
} ) ;
1911
1824
1912
1825
const {
@@ -1942,9 +1855,8 @@ test('Throw SemanticReleaseError if "labels" option is a whitespace String', asy
1942
1855
1943
1856
const fetch = fetchMock
1944
1857
. sandbox ( )
1945
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1858
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1946
1859
permissions : { push : true } ,
1947
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1948
1860
} ) ;
1949
1861
1950
1862
const {
@@ -1980,9 +1892,8 @@ test('Throw SemanticReleaseError if "assignees" option is not a String or an Arr
1980
1892
1981
1893
const fetch = fetchMock
1982
1894
. sandbox ( )
1983
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1895
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1984
1896
permissions : { push : true } ,
1985
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
1986
1897
} ) ;
1987
1898
1988
1899
const {
@@ -2018,9 +1929,8 @@ test('Throw SemanticReleaseError if "assignees" option is an Array with invalid
2018
1929
2019
1930
const fetch = fetchMock
2020
1931
. sandbox ( )
2021
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1932
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2022
1933
permissions : { push : true } ,
2023
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2024
1934
} ) ;
2025
1935
2026
1936
const {
@@ -2056,9 +1966,8 @@ test('Throw SemanticReleaseError if "assignees" option is a whitespace String',
2056
1966
2057
1967
const fetch = fetchMock
2058
1968
. sandbox ( )
2059
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
1969
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2060
1970
permissions : { push : true } ,
2061
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2062
1971
} ) ;
2063
1972
2064
1973
const {
@@ -2094,9 +2003,8 @@ test('Throw SemanticReleaseError if "releasedLabels" option is not a String or a
2094
2003
2095
2004
const fetch = fetchMock
2096
2005
. sandbox ( )
2097
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2006
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2098
2007
permissions : { push : true } ,
2099
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2100
2008
} ) ;
2101
2009
2102
2010
const {
@@ -2132,9 +2040,8 @@ test('Throw SemanticReleaseError if "releasedLabels" option is an Array with inv
2132
2040
2133
2041
const fetch = fetchMock
2134
2042
. sandbox ( )
2135
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2043
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2136
2044
permissions : { push : true } ,
2137
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2138
2045
} ) ;
2139
2046
2140
2047
const {
@@ -2170,9 +2077,8 @@ test('Throw SemanticReleaseError if "releasedLabels" option is a whitespace Stri
2170
2077
2171
2078
const fetch = fetchMock
2172
2079
. sandbox ( )
2173
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2080
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2174
2081
permissions : { push : true } ,
2175
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2176
2082
} ) ;
2177
2083
2178
2084
const {
@@ -2208,9 +2114,8 @@ test('Throw SemanticReleaseError if "addReleases" option is not a valid string (
2208
2114
2209
2115
const fetch = fetchMock
2210
2116
. sandbox ( )
2211
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2117
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2212
2118
permissions : { push : true } ,
2213
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2214
2119
} ) ;
2215
2120
2216
2121
const {
@@ -2246,9 +2151,8 @@ test('Throw SemanticReleaseError if "addReleases" option is not a valid string (
2246
2151
2247
2152
const fetch = fetchMock
2248
2153
. sandbox ( )
2249
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2154
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2250
2155
permissions : { push : true } ,
2251
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2252
2156
} ) ;
2253
2157
2254
2158
const {
@@ -2284,9 +2188,8 @@ test('Throw SemanticReleaseError if "addReleases" option is not a valid string (
2284
2188
2285
2189
const fetch = fetchMock
2286
2190
. sandbox ( )
2287
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2191
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2288
2192
permissions : { push : true } ,
2289
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2290
2193
} ) ;
2291
2194
2292
2195
const {
@@ -2322,9 +2225,8 @@ test('Throw SemanticReleaseError if "draftRelease" option is not a valid boolean
2322
2225
2323
2226
const fetch = fetchMock
2324
2227
. sandbox ( )
2325
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2228
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2326
2229
permissions : { push : true } ,
2327
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2328
2230
} ) ;
2329
2231
2330
2232
const {
@@ -2359,9 +2261,8 @@ test('Throw SemanticReleaseError if "releaseBodyTemplate" option is an empty str
2359
2261
2360
2262
const fetch = fetchMock
2361
2263
. sandbox ( )
2362
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2264
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2363
2265
permissions : { push : true } ,
2364
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2365
2266
} ) ;
2366
2267
2367
2268
const {
@@ -2396,9 +2297,8 @@ test('Throw SemanticReleaseError if "releaseNameTemplate" option is an empty str
2396
2297
2397
2298
const fetch = fetchMock
2398
2299
. sandbox ( )
2399
- . get ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2300
+ . getOnce ( `https://api.github.local/repos/${ owner } /${ repo } ` , {
2400
2301
permissions : { push : true } ,
2401
- clone_url : `https://github.com/${ owner } /${ repo } .git` ,
2402
2302
} ) ;
2403
2303
2404
2304
const {
0 commit comments