1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
- /* eslint-disable @typescript-eslint/camelcase */
3
1
jest . mock ( "open" ) ;
4
2
import open from "open" ;
5
3
jest . mock ( "../../config" ) ;
@@ -32,18 +30,18 @@ afterAll(() => {
32
30
33
31
const mockConfig = ( ) : void => {
34
32
( Config as jest . Mock ) . mockReturnValueOnce ( {
35
- azure_devops : {
36
- access_token : uuid ( ) ,
33
+ " azure_devops" : {
34
+ " access_token" : uuid ( ) ,
37
35
org : uuid ( ) ,
38
36
project : uuid ( )
39
37
} ,
40
38
introspection : {
41
39
azure : {
42
- account_name : uuid ( ) ,
40
+ " account_name" : uuid ( ) ,
43
41
key : uuid ( ) ,
44
- partition_key : uuid ( ) ,
45
- source_repo_access_token : "test_token" ,
46
- table_name : uuid ( )
42
+ " partition_key" : uuid ( ) ,
43
+ " source_repo_access_token" : "test_token" ,
44
+ " table_name" : uuid ( )
47
45
}
48
46
}
49
47
} ) ;
@@ -134,6 +132,7 @@ describe("Validate dashboard container pull", () => {
134
132
const dockerId = await exec ( "docker" , [
135
133
"images" ,
136
134
"-q" ,
135
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
137
136
config . introspection ! . dashboard ! . image !
138
137
] ) ;
139
138
expect ( dockerId ) . toBeDefined ( ) ;
@@ -160,6 +159,7 @@ describe("Validate dashboard clean up", () => {
160
159
const dockerId = await exec ( "docker" , [
161
160
"images" ,
162
161
"-q" ,
162
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
163
163
config . introspection ! . dashboard ! . image !
164
164
] ) ;
165
165
@@ -185,6 +185,7 @@ describe("Fallback to azure devops access token", () => {
185
185
const envVars = ( await getEnvVars ( config ) ) . toString ( ) ;
186
186
logger . info (
187
187
`spin: ${ envVars } , act: ${
188
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
188
189
config . introspection ! . azure ! . source_repo_access_token
189
190
} `
190
191
) ;
@@ -198,6 +199,7 @@ describe("Fallback to azure devops access token", () => {
198
199
const envVars = ( await getEnvVars ( config ) ) . toString ( ) ;
199
200
const expectedSubstring =
200
201
"REACT_APP_SOURCE_REPO_ACCESS_TOKEN=" +
202
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
201
203
config . introspection ! . azure ! . source_repo_access_token ! ;
202
204
expect ( envVars . includes ( expectedSubstring ) ) . toBeTruthy ( ) ;
203
205
} ) ;
@@ -206,21 +208,26 @@ describe("Fallback to azure devops access token", () => {
206
208
describe ( "Extract manifest repository information" , ( ) => {
207
209
test ( "Manifest repository information is successfully extracted" , ( ) => {
208
210
( Config as jest . Mock ) . mockReturnValue ( {
209
- azure_devops : {
210
- manifest_repository :
211
+ " azure_devops" : {
212
+ " manifest_repository" :
211
213
"https://dev.azure.com/bhnook/fabrikam/_git/materialized"
212
214
}
213
215
} ) ;
214
216
const config = Config ( ) ;
215
217
let manifestInfo = extractManifestRepositoryInformation ( config ) ;
216
218
expect ( manifestInfo ) . toBeDefined ( ) ;
219
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
217
220
expect ( manifestInfo ! . githubUsername ) . toBeUndefined ( ) ;
221
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
218
222
expect ( manifestInfo ! . manifestRepoName ) . toBe ( "materialized" ) ;
219
- config . azure_devops ! . manifest_repository =
223
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
224
+ config . azure_devops ! [ "manifest_repository" ] =
220
225
"https://github.com/username/manifest" ;
221
226
manifestInfo = extractManifestRepositoryInformation ( config ) ;
222
227
expect ( manifestInfo ) . toBeDefined ( ) ;
228
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
223
229
expect ( manifestInfo ! . githubUsername ) . toBe ( "username" ) ;
230
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
224
231
expect ( manifestInfo ! . manifestRepoName ) . toBe ( "manifest" ) ;
225
232
226
233
logger . info ( "Verified that manifest repository extraction works" ) ;
0 commit comments