@@ -2,6 +2,7 @@ import * as core from '@actions/core';
2
2
import type { RestEndpointMethods } from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types' ;
3
3
import { when } from 'jest-when' ;
4
4
import ghAction from '@github/actions/javascript/postTestBuildComment/postTestBuildComment' ;
5
+ import CONST from '@github/libs/CONST' ;
5
6
import type { CreateCommentResponse } from '@github/libs/GithubUtils' ;
6
7
import GithubUtils from '@github/libs/GithubUtils' ;
7
8
import asMutable from '@src/types/utils/asMutable' ;
@@ -31,8 +32,9 @@ Object.defineProperty(GithubUtils, 'graphql', {
31
32
jest . mock ( '@actions/github' , ( ) => ( {
32
33
context : {
33
34
repo : {
34
- owner : 'Expensify' ,
35
- repo : 'App' ,
35
+ owner : process . env . GITHUB_REPOSITORY_OWNER ,
36
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
37
+ repo : process . env . GITHUB_REPOSITORY . split ( '/' ) . at ( 1 ) ! ,
36
38
} ,
37
39
runId : 1234 ,
38
40
} ,
@@ -116,7 +118,7 @@ describe('Post test build comments action tests', () => {
116
118
}
117
119
` ) ;
118
120
expect ( createCommentMock ) . toBeCalledTimes ( 1 ) ;
119
- expect ( createCommentMock ) . toBeCalledWith ( 'App' , 12 , message ) ;
121
+ expect ( createCommentMock ) . toBeCalledWith ( CONST . APP_REPO , 12 , message ) ;
120
122
} ) ;
121
123
122
124
test ( 'Test GH action when input is not complete' , async ( ) => {
@@ -148,6 +150,6 @@ describe('Post test build comments action tests', () => {
148
150
}
149
151
` ) ;
150
152
expect ( createCommentMock ) . toBeCalledTimes ( 1 ) ;
151
- expect ( createCommentMock ) . toBeCalledWith ( 'App' , 12 , onlyAndroidMessage ) ;
153
+ expect ( createCommentMock ) . toBeCalledWith ( CONST . APP_REPO , 12 , onlyAndroidMessage ) ;
152
154
} ) ;
153
155
} ) ;
0 commit comments