@@ -34,7 +34,6 @@ const ENVIRONMENT = 'dev';
3434const GITHUB_APP_ID = '1' ;
3535const PARAMETER_GITHUB_APP_ID_NAME = `/actions-runner/${ ENVIRONMENT } /github_app_id` ;
3636const PARAMETER_GITHUB_APP_KEY_BASE64_NAME = `/actions-runner/${ ENVIRONMENT } /github_app_key_base64` ;
37- const storageProviderType = 'aws_ssm' as const ;
3837
3938const mockedGetParameters = vi . mocked ( getParameters ) ;
4039
@@ -91,7 +90,7 @@ describe('Test createGithubAppAuth', () => {
9190 it ( 'Throws early when PARAMETER_GITHUB_APP_ID_NAME is not set' , async ( ) => {
9291 delete process . env . PARAMETER_GITHUB_APP_ID_NAME ;
9392
94- await expect ( createGithubAppAuth ( storageProviderType , installationId ) ) . rejects . toThrow (
93+ await expect ( createGithubAppAuth ( installationId ) ) . rejects . toThrow (
9594 'Environment variable PARAMETER_GITHUB_APP_ID_NAME is not set' ,
9695 ) ;
9796 expect ( mockedGetParameters ) . not . toHaveBeenCalled ( ) ;
@@ -100,7 +99,7 @@ describe('Test createGithubAppAuth', () => {
10099 it ( 'Throws early when PARAMETER_GITHUB_APP_KEY_BASE64_NAME is not set' , async ( ) => {
101100 delete process . env . PARAMETER_GITHUB_APP_KEY_BASE64_NAME ;
102101
103- await expect ( createGithubAppAuth ( storageProviderType , installationId ) ) . rejects . toThrow (
102+ await expect ( createGithubAppAuth ( installationId ) ) . rejects . toThrow (
104103 'Environment variable PARAMETER_GITHUB_APP_KEY_BASE64_NAME is not set' ,
105104 ) ;
106105 expect ( mockedGetParameters ) . not . toHaveBeenCalled ( ) ;
@@ -121,7 +120,7 @@ describe('Test createGithubAppAuth', () => {
121120 mockedCreatAppAuth . mockReturnValue ( mockWithHook ) ;
122121
123122 // Act
124- await createGithubAppAuth ( storageProviderType , installationId ) ;
123+ await createGithubAppAuth ( installationId ) ;
125124
126125 // Assert
127126 expect ( mockedCreatAppAuth ) . toBeCalledTimes ( 1 ) ;
@@ -156,7 +155,7 @@ describe('Test createGithubAppAuth', () => {
156155 } ) ;
157156
158157 // Act
159- await createGithubAppAuth ( storageProviderType , installationId ) ;
158+ await createGithubAppAuth ( installationId ) ;
160159
161160 // Generate two JWTs and verify they are different (jti makes them unique)
162161 const jwt1 = await capturedCreateJwt ! ( 1 ) ;
@@ -193,7 +192,7 @@ describe('Test createGithubAppAuth', () => {
193192 mockedCreatAppAuth . mockReturnValue ( mockWithHook ) ;
194193
195194 // Act
196- const result = await createGithubAppAuth ( storageProviderType , installationId ) ;
195+ const result = await createGithubAppAuth ( installationId ) ;
197196
198197 // Assert
199198 expect ( getParameters ) . toBeCalledWith ( [ PARAMETER_GITHUB_APP_ID_NAME , PARAMETER_GITHUB_APP_KEY_BASE64_NAME ] ) ;
@@ -217,7 +216,7 @@ describe('Test createGithubAppAuth', () => {
217216 mockedCreatAppAuth . mockReturnValue ( mockWithHook ) ;
218217
219218 // Act
220- const result = await createGithubAppAuth ( storageProviderType , installationId ) ;
219+ const result = await createGithubAppAuth ( installationId ) ;
221220
222221 // Assert
223222 expect ( getParameters ) . toBeCalledWith ( [ PARAMETER_GITHUB_APP_ID_NAME , PARAMETER_GITHUB_APP_KEY_BASE64_NAME ] ) ;
@@ -254,7 +253,7 @@ describe('Test createGithubAppAuth', () => {
254253 } ) ;
255254
256255 // Act
257- const result = await createGithubAppAuth ( storageProviderType , installationId , githubServerUrl ) ;
256+ const result = await createGithubAppAuth ( installationId , githubServerUrl ) ;
258257
259258 // Assert
260259 expect ( getParameters ) . toBeCalledWith ( [ PARAMETER_GITHUB_APP_ID_NAME , PARAMETER_GITHUB_APP_KEY_BASE64_NAME ] ) ;
@@ -292,7 +291,7 @@ describe('Test createGithubAppAuth', () => {
292291 mockedCreatAppAuth . mockReturnValue ( mockWithHook ) ;
293292
294293 // Act
295- const result = await createGithubAppAuth ( storageProviderType , installationId , githubServerUrl ) ;
294+ const result = await createGithubAppAuth ( installationId , githubServerUrl ) ;
296295
297296 // Assert
298297 expect ( getParameters ) . toBeCalledWith ( [ PARAMETER_GITHUB_APP_ID_NAME , PARAMETER_GITHUB_APP_KEY_BASE64_NAME ] ) ;
@@ -354,7 +353,7 @@ describe('Test getStoredInstallationId', () => {
354353 ] ) ,
355354 ) ;
356355
357- const result = await getStoredInstallationId ( storageProviderType , 0 ) ;
356+ const result = await getStoredInstallationId ( 0 ) ;
358357 expect ( result ) . toBe ( 12345 ) ;
359358 } ) ;
360359
@@ -369,8 +368,8 @@ describe('Test getStoredInstallationId', () => {
369368 ] ) ,
370369 ) ;
371370
372- await expect ( getAppId ( storageProviderType , 0 ) ) . resolves . toBe ( GITHUB_APP_ID ) ;
373- await expect ( getStoredInstallationId ( storageProviderType , 0 ) ) . resolves . toBe ( 12345 ) ;
371+ await expect ( getAppId ( 0 ) ) . resolves . toBe ( GITHUB_APP_ID ) ;
372+ await expect ( getStoredInstallationId ( 0 ) ) . resolves . toBe ( 12345 ) ;
374373 expect ( mockedGetParameters ) . toHaveBeenCalledTimes ( 1 ) ;
375374 } ) ;
376375
@@ -382,8 +381,8 @@ describe('Test getStoredInstallationId', () => {
382381 ] ) ,
383382 ) ;
384383
385- await expect ( getAppId ( storageProviderType ) ) . rejects . toThrow ( 'temporary storage failure' ) ;
386- await expect ( getAppId ( storageProviderType ) ) . resolves . toBe ( GITHUB_APP_ID ) ;
384+ await expect ( getAppId ( ) ) . rejects . toThrow ( 'temporary storage failure' ) ;
385+ await expect ( getAppId ( ) ) . resolves . toBe ( GITHUB_APP_ID ) ;
387386 expect ( mockedGetParameters ) . toHaveBeenCalledTimes ( 2 ) ;
388387 } ) ;
389388
@@ -396,7 +395,7 @@ describe('Test getStoredInstallationId', () => {
396395 ] ) ,
397396 ) ;
398397
399- const result = await getStoredInstallationId ( storageProviderType , 0 ) ;
398+ const result = await getStoredInstallationId ( 0 ) ;
400399 expect ( result ) . toBeUndefined ( ) ;
401400 } ) ;
402401
@@ -409,7 +408,7 @@ describe('Test getStoredInstallationId', () => {
409408 ] ) ,
410409 ) ;
411410
412- const result = await getStoredInstallationId ( storageProviderType , 0 ) ;
411+ const result = await getStoredInstallationId ( 0 ) ;
413412 expect ( result ) . toBeUndefined ( ) ;
414413 } ) ;
415414
@@ -422,7 +421,7 @@ describe('Test getStoredInstallationId', () => {
422421 ] ) ,
423422 ) ;
424423
425- const result = await getStoredInstallationId ( storageProviderType , 99 ) ;
424+ const result = await getStoredInstallationId ( 99 ) ;
426425 expect ( result ) . toBeUndefined ( ) ;
427426 } ) ;
428427
@@ -448,11 +447,11 @@ describe('Test getStoredInstallationId', () => {
448447 ) ;
449448
450449 // Primary app (index 0) has no stored installation ID
451- const result0 = await getStoredInstallationId ( storageProviderType , 0 ) ;
450+ const result0 = await getStoredInstallationId ( 0 ) ;
452451 expect ( result0 ) . toBeUndefined ( ) ;
453452
454453 // Additional app (index 1) has stored installation ID
455- const result1 = await getStoredInstallationId ( storageProviderType , 1 ) ;
454+ const result1 = await getStoredInstallationId ( 1 ) ;
456455 expect ( result1 ) . toBe ( 67890 ) ;
457456 } ) ;
458457} ) ;
0 commit comments