@@ -62,7 +62,7 @@ describe('Synchronize action distribution.', () => {
62
62
mockS3 . getObjectTagging . mockImplementation ( ( ) => {
63
63
return {
64
64
promise ( ) {
65
- return Promise . resolve ( { TagSet : [ { Key : 'name' , Value : 'actions-runner-linux-x64-2.272.0 .tar.gz' } ] } ) ;
65
+ return Promise . resolve ( { TagSet : [ { Key : 'name' , Value : 'actions-runner-linux-x64-2.285.1 .tar.gz' } ] } ) ;
66
66
} ,
67
67
} ;
68
68
} ) ;
@@ -86,7 +86,7 @@ describe('Synchronize action distribution.', () => {
86
86
mockS3 . getObjectTagging . mockImplementation ( ( ) => {
87
87
return {
88
88
promise ( ) {
89
- return Promise . resolve ( { TagSet : [ { Key : 'name' , Value : 'actions-runner-linux-x64-2.272.0 .tar.gz' } ] } ) ;
89
+ return Promise . resolve ( { TagSet : [ { Key : 'name' , Value : 'actions-runner-linux-x64-2.285.1 .tar.gz' } ] } ) ;
90
90
} ,
91
91
} ;
92
92
} ) ;
@@ -105,7 +105,7 @@ describe('Synchronize action distribution.', () => {
105
105
mockS3 . getObjectTagging . mockImplementation ( ( ) => {
106
106
return {
107
107
promise ( ) {
108
- return Promise . resolve ( { TagSet : [ { Key : 'name' , Value : 'actions-runner-linux-x64-2.273 .0.tar.gz' } ] } ) ;
108
+ return Promise . resolve ( { TagSet : [ { Key : 'name' , Value : 'actions-runner-linux-x64-2.286 .0.tar.gz' } ] } ) ;
109
109
} ,
110
110
} ;
111
111
} ) ;
@@ -136,7 +136,7 @@ describe('Synchronize action distribution.', () => {
136
136
} ) ;
137
137
expect ( mockS3 . upload ) . toBeCalledTimes ( 1 ) ;
138
138
const s3JsonBody = mockS3 . upload . mock . calls [ 0 ] [ 0 ] ;
139
- expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.272.0 .tar.gz' ) ;
139
+ expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.285.1 .tar.gz' ) ;
140
140
} ) ;
141
141
142
142
it ( 'Distribution should update to release if there are no pre-releases.' , async ( ) => {
@@ -162,7 +162,7 @@ describe('Synchronize action distribution.', () => {
162
162
} ) ;
163
163
expect ( mockS3 . upload ) . toBeCalledTimes ( 1 ) ;
164
164
const s3JsonBody = mockS3 . upload . mock . calls [ 0 ] [ 0 ] ;
165
- expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.272.0 .tar.gz' ) ;
165
+ expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.285.1 .tar.gz' ) ;
166
166
} ) ;
167
167
168
168
it ( 'Distribution should update to prerelease.' , async ( ) => {
@@ -183,7 +183,7 @@ describe('Synchronize action distribution.', () => {
183
183
} ) ;
184
184
expect ( mockS3 . upload ) . toBeCalledTimes ( 1 ) ;
185
185
const s3JsonBody = mockS3 . upload . mock . calls [ 0 ] [ 0 ] ;
186
- expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.273 .0.tar.gz' ) ;
186
+ expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.286 .0.tar.gz' ) ;
187
187
} ) ;
188
188
189
189
it ( 'Distribution should not update to prerelease if there is a newer release.' , async ( ) => {
@@ -211,7 +211,7 @@ describe('Synchronize action distribution.', () => {
211
211
} ) ;
212
212
expect ( mockS3 . upload ) . toBeCalledTimes ( 1 ) ;
213
213
const s3JsonBody = mockS3 . upload . mock . calls [ 0 ] [ 0 ] ;
214
- expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.273 .0.tar.gz' ) ;
214
+ expect ( s3JsonBody [ 'Tagging' ] ) . toEqual ( 'name=actions-runner-linux-x64-2.286 .0.tar.gz' ) ;
215
215
} ) ;
216
216
217
217
it ( 'No tag in S3, distribution should update.' , async ( ) => {
@@ -273,6 +273,14 @@ describe('No release assets found.', () => {
273
273
274
274
await expect ( sync ( ) ) . rejects . toThrow ( errorMessage ) ;
275
275
} ) ;
276
+
277
+ it ( 'Empty asset list.' , async ( ) => {
278
+ mockOctokit . repos . listReleases . mockImplementation ( ( ) => ( {
279
+ data : [ ] ,
280
+ } ) ) ;
281
+
282
+ await expect ( sync ( ) ) . rejects . toThrow ( errorMessage ) ;
283
+ } ) ;
276
284
} ) ;
277
285
278
286
describe ( 'Invalid config' , ( ) => {
0 commit comments