@@ -15,7 +15,7 @@ test.beforeEach((t) => {
15
15
t . context . logger = { log : t . context . log , error : t . context . error } ;
16
16
} ) ;
17
17
18
- test . serial ( "Update a release" , async ( t ) => {
18
+ test ( "Update a release" , async ( t ) => {
19
19
const owner = "test_user" ;
20
20
const repo = "test_repo" ;
21
21
const env = { GITHUB_TOKEN : "github_token" } ;
@@ -76,7 +76,7 @@ test.serial("Update a release", async (t) => {
76
76
t . true ( fetch . done ( ) ) ;
77
77
} ) ;
78
78
79
- test . serial ( "Update a maintenance release" , async ( t ) => {
79
+ test ( "Update a maintenance release" , async ( t ) => {
80
80
const owner = "test_user" ;
81
81
const repo = "test_repo" ;
82
82
const env = { GITHUB_TOKEN : "github_token" } ;
@@ -138,7 +138,7 @@ test.serial("Update a maintenance release", async (t) => {
138
138
t . true ( fetch . done ( ) ) ;
139
139
} ) ;
140
140
141
- test . serial ( "Update a prerelease" , async ( t ) => {
141
+ test ( "Update a prerelease" , async ( t ) => {
142
142
const owner = "test_user" ;
143
143
const repo = "test_repo" ;
144
144
const env = { GITHUB_TOKEN : "github_token" } ;
@@ -199,7 +199,7 @@ test.serial("Update a prerelease", async (t) => {
199
199
t . true ( fetch . done ( ) ) ;
200
200
} ) ;
201
201
202
- test . serial ( "Update a release with a custom github url" , async ( t ) => {
202
+ test ( "Update a release with a custom github url" , async ( t ) => {
203
203
const owner = "test_user" ;
204
204
const repo = "test_repo" ;
205
205
const env = {
@@ -264,7 +264,7 @@ test.serial("Update a release with a custom github url", async (t) => {
264
264
t . true ( fetch . done ( ) ) ;
265
265
} ) ;
266
266
267
- test . serial ( "Create the new release if current one is missing" , async ( t ) => {
267
+ test ( "Create the new release if current one is missing" , async ( t ) => {
268
268
const owner = "test_user" ;
269
269
const repo = "test_repo" ;
270
270
const env = { GITHUB_TOKEN : "github_token" } ;
@@ -327,7 +327,7 @@ test.serial("Create the new release if current one is missing", async (t) => {
327
327
t . true ( fetch . done ( ) ) ;
328
328
} ) ;
329
329
330
- test . serial ( "Throw error if cannot read current release" , async ( t ) => {
330
+ test ( "Throw error if cannot read current release" , async ( t ) => {
331
331
const owner = "test_user" ;
332
332
const repo = "test_repo" ;
333
333
const env = { GITHUB_TOKEN : "github_token" } ;
@@ -369,66 +369,59 @@ test.serial("Throw error if cannot read current release", async (t) => {
369
369
t . true ( fetch . done ( ) ) ;
370
370
} ) ;
371
371
372
- test . serial (
373
- "Throw error if cannot create missing current release" ,
374
- async ( t ) => {
375
- const owner = "test_user" ;
376
- const repo = "test_repo" ;
377
- const env = { GITHUB_TOKEN : "github_token" } ;
378
- const pluginConfig = { } ;
379
- const nextRelease = {
380
- gitTag : "v1.0.0" ,
381
- name : "v1.0.0" ,
382
- notes : "Test release note body" ,
383
- } ;
384
- const options = {
385
- repositoryUrl : `https://github.com/${ owner } /${ repo } .git` ,
386
- } ;
387
-
388
- const fetch = fetchMock
389
- . sandbox ( )
390
- . getOnce (
391
- `https://api.github.local/repos/${ owner } /${ repo } /releases/tags/${ nextRelease . gitTag } ` ,
392
- 404
393
- )
394
- . postOnce (
395
- `https://api.github.local/repos/${ owner } /${ repo } /releases` ,
396
- 500 ,
397
- {
398
- body : {
399
- tag_name : nextRelease . gitTag ,
400
- name : nextRelease . name ,
401
- body : nextRelease . notes ,
402
- prerelease : false ,
403
- } ,
404
- }
405
- ) ;
406
-
407
- const error = await t . throwsAsync (
408
- addChannel (
409
- pluginConfig ,
410
- {
411
- env,
412
- options,
413
- branch : { type : "release" , main : true } ,
414
- nextRelease,
415
- logger : t . context . logger ,
416
- } ,
417
- {
418
- Octokit : TestOctokit . defaults ( ( options ) => ( {
419
- ...options ,
420
- request : { ...options . request , fetch } ,
421
- } ) ) ,
422
- }
423
- )
424
- ) ;
372
+ test ( "Throw error if cannot create missing current release" , async ( t ) => {
373
+ const owner = "test_user" ;
374
+ const repo = "test_repo" ;
375
+ const env = { GITHUB_TOKEN : "github_token" } ;
376
+ const pluginConfig = { } ;
377
+ const nextRelease = {
378
+ gitTag : "v1.0.0" ,
379
+ name : "v1.0.0" ,
380
+ notes : "Test release note body" ,
381
+ } ;
382
+ const options = {
383
+ repositoryUrl : `https://github.com/${ owner } /${ repo } .git` ,
384
+ } ;
385
+
386
+ const fetch = fetchMock
387
+ . sandbox ( )
388
+ . getOnce (
389
+ `https://api.github.local/repos/${ owner } /${ repo } /releases/tags/${ nextRelease . gitTag } ` ,
390
+ 404
391
+ )
392
+ . postOnce ( `https://api.github.local/repos/${ owner } /${ repo } /releases` , 500 , {
393
+ body : {
394
+ tag_name : nextRelease . gitTag ,
395
+ name : nextRelease . name ,
396
+ body : nextRelease . notes ,
397
+ prerelease : false ,
398
+ } ,
399
+ } ) ;
400
+
401
+ const error = await t . throwsAsync (
402
+ addChannel (
403
+ pluginConfig ,
404
+ {
405
+ env,
406
+ options,
407
+ branch : { type : "release" , main : true } ,
408
+ nextRelease,
409
+ logger : t . context . logger ,
410
+ } ,
411
+ {
412
+ Octokit : TestOctokit . defaults ( ( options ) => ( {
413
+ ...options ,
414
+ request : { ...options . request , fetch } ,
415
+ } ) ) ,
416
+ }
417
+ )
418
+ ) ;
425
419
426
- t . is ( error . status , 500 ) ;
427
- t . true ( fetch . done ( ) ) ;
428
- }
429
- ) ;
420
+ t . is ( error . status , 500 ) ;
421
+ t . true ( fetch . done ( ) ) ;
422
+ } ) ;
430
423
431
- test . serial ( "Throw error if cannot update release" , async ( t ) => {
424
+ test ( "Throw error if cannot update release" , async ( t ) => {
432
425
const owner = "test_user" ;
433
426
const repo = "test_repo" ;
434
427
const env = { GITHUB_TOKEN : "github_token" } ;
0 commit comments