@@ -714,7 +714,7 @@ test.serial("Publish a release with error response", async (t) => {
714714} ) ;
715715
716716test . serial ( "Publish a release with templated wildcard path" , async ( t ) => {
717- const cwd = "test/fixtures/wildcard-test " ;
717+ const cwd = "test/fixtures/files " ;
718718 const owner = "test_user" ;
719719 const repo = "test_repo" ;
720720 const env = { GITLAB_TOKEN : "gitlab_token" } ;
@@ -723,18 +723,12 @@ test.serial("Publish a release with templated wildcard path", async (t) => {
723723 const encodedProjectPath = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
724724 const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
725725
726- // This pattern should match both "my-project-v1.0.0.zip" and "my-project-v1.0.0-alpha.zip"
727- const assets = [ "release/my-project-v${nextRelease.version}*.zip" ] ;
726+ const assets = [ "versioned/upload_v${nextRelease.version}.txt" ] ;
728727
729- const uploaded1 = {
730- url : "/uploads/my-project-v1.0.0.zip" ,
731- alt : "my-project-v1.0.0.zip" ,
732- full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/my-project-v1.0.0.zip" ,
733- } ;
734- const uploaded2 = {
735- url : "/uploads/my-project-v1.0.0-alpha.zip" ,
736- alt : "my-project-v1.0.0-alpha.zip" ,
737- full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/my-project-v1.0.0-alpha.zip" ,
728+ const uploaded = {
729+ url : "/uploads/upload_v1.0.0.txt" ,
730+ alt : "upload_v1.0.0.txt" ,
731+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/upload_v1.0.0.txt" ,
738732 } ;
739733
740734 const gitlab = authenticate ( env )
@@ -744,32 +738,22 @@ test.serial("Publish a release with templated wildcard path", async (t) => {
744738 assets : {
745739 links : [
746740 {
747- name : "my-project-v1.0.0-alpha.zip" ,
748- url : `https://gitlab.com${ uploaded2 . full_path } ` ,
749- } ,
750- {
751- name : "my-project-v1.0.0.zip" ,
752- url : `https://gitlab.com${ uploaded1 . full_path } ` ,
741+ name : "upload_v1.0.0.txt" ,
742+ url : `https://gitlab.com${ uploaded . full_path } ` ,
753743 } ,
754744 ] ,
755745 } ,
756746 } )
757747 . reply ( 200 ) ;
758- const gitlabUpload1 = authenticate ( env )
759- . post ( `/projects/${ encodedProjectPath } /uploads` , / C o n t e n t - D i s p o s i t i o n .* m y - p r o j e c t - v 1 \. 0 \. 0 \. z i p / g)
760- . reply ( 200 , uploaded1 ) ;
761- const gitlabUpload2 = authenticate ( env )
762- . post ( `/projects/${ encodedProjectPath } /uploads` , / C o n t e n t - D i s p o s i t i o n .* m y - p r o j e c t - v 1 \. 0 \. 0 - a l p h a \. z i p / g)
763- . reply ( 200 , uploaded2 ) ;
748+ const gitlabUpload = authenticate ( env )
749+ . post ( `/projects/${ encodedProjectPath } /uploads` , / C o n t e n t - D i s p o s i t i o n .* u p l o a d _ v 1 \. 0 \. 0 \. t x t / g)
750+ . reply ( 200 , uploaded ) ;
764751
765752 const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
766753
767754 t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
768- // Should upload both files that match the wildcard pattern (in alphabetical order)
769- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com${ uploaded2 . full_path } ` ] ) ;
770- t . deepEqual ( t . context . log . args [ 1 ] , [ "Uploaded file: %s" , `https://gitlab.com${ uploaded1 . full_path } ` ] ) ;
771- t . deepEqual ( t . context . log . args [ 2 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
755+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com${ uploaded . full_path } ` ] ) ;
756+ t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
772757 t . true ( gitlab . isDone ( ) ) ;
773- t . true ( gitlabUpload1 . isDone ( ) ) ;
774- t . true ( gitlabUpload2 . isDone ( ) ) ;
758+ t . true ( gitlabUpload . isDone ( ) ) ;
775759} ) ;
0 commit comments