@@ -15,7 +15,7 @@ test.beforeEach((t) => {
1515 t . context . logger = { log : t . context . log , error : t . context . error } ;
1616} ) ;
1717
18- test . serial ( "Update a release" , async ( t ) => {
18+ test ( "Update a release" , async ( t ) => {
1919 const owner = "test_user" ;
2020 const repo = "test_repo" ;
2121 const env = { GITHUB_TOKEN : "github_token" } ;
@@ -76,7 +76,7 @@ test.serial("Update a release", async (t) => {
7676 t . true ( fetch . done ( ) ) ;
7777} ) ;
7878
79- test . serial ( "Update a maintenance release" , async ( t ) => {
79+ test ( "Update a maintenance release" , async ( t ) => {
8080 const owner = "test_user" ;
8181 const repo = "test_repo" ;
8282 const env = { GITHUB_TOKEN : "github_token" } ;
@@ -138,7 +138,7 @@ test.serial("Update a maintenance release", async (t) => {
138138 t . true ( fetch . done ( ) ) ;
139139} ) ;
140140
141- test . serial ( "Update a prerelease" , async ( t ) => {
141+ test ( "Update a prerelease" , async ( t ) => {
142142 const owner = "test_user" ;
143143 const repo = "test_repo" ;
144144 const env = { GITHUB_TOKEN : "github_token" } ;
@@ -199,7 +199,7 @@ test.serial("Update a prerelease", async (t) => {
199199 t . true ( fetch . done ( ) ) ;
200200} ) ;
201201
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 ) => {
203203 const owner = "test_user" ;
204204 const repo = "test_repo" ;
205205 const env = {
@@ -264,7 +264,7 @@ test.serial("Update a release with a custom github url", async (t) => {
264264 t . true ( fetch . done ( ) ) ;
265265} ) ;
266266
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 ) => {
268268 const owner = "test_user" ;
269269 const repo = "test_repo" ;
270270 const env = { GITHUB_TOKEN : "github_token" } ;
@@ -327,7 +327,7 @@ test.serial("Create the new release if current one is missing", async (t) => {
327327 t . true ( fetch . done ( ) ) ;
328328} ) ;
329329
330- test . serial ( "Throw error if cannot read current release" , async ( t ) => {
330+ test ( "Throw error if cannot read current release" , async ( t ) => {
331331 const owner = "test_user" ;
332332 const repo = "test_repo" ;
333333 const env = { GITHUB_TOKEN : "github_token" } ;
@@ -369,66 +369,59 @@ test.serial("Throw error if cannot read current release", async (t) => {
369369 t . true ( fetch . done ( ) ) ;
370370} ) ;
371371
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+ ) ;
425419
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+ } ) ;
430423
431- test . serial ( "Throw error if cannot update release" , async ( t ) => {
424+ test ( "Throw error if cannot update release" , async ( t ) => {
432425 const owner = "test_user" ;
433426 const repo = "test_repo" ;
434427 const env = { GITHUB_TOKEN : "github_token" } ;
0 commit comments