1- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2- /* eslint-disable @typescript-eslint/camelcase */
31jest . mock ( "open" ) ;
42import open from "open" ;
53jest . mock ( "../../config" ) ;
@@ -32,18 +30,18 @@ afterAll(() => {
3230
3331const mockConfig = ( ) : void => {
3432 ( Config as jest . Mock ) . mockReturnValueOnce ( {
35- azure_devops : {
36- access_token : uuid ( ) ,
33+ " azure_devops" : {
34+ " access_token" : uuid ( ) ,
3735 org : uuid ( ) ,
3836 project : uuid ( )
3937 } ,
4038 introspection : {
4139 azure : {
42- account_name : uuid ( ) ,
40+ " account_name" : uuid ( ) ,
4341 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 ( )
4745 }
4846 }
4947 } ) ;
@@ -134,6 +132,7 @@ describe("Validate dashboard container pull", () => {
134132 const dockerId = await exec ( "docker" , [
135133 "images" ,
136134 "-q" ,
135+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
137136 config . introspection ! . dashboard ! . image !
138137 ] ) ;
139138 expect ( dockerId ) . toBeDefined ( ) ;
@@ -160,6 +159,7 @@ describe("Validate dashboard clean up", () => {
160159 const dockerId = await exec ( "docker" , [
161160 "images" ,
162161 "-q" ,
162+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
163163 config . introspection ! . dashboard ! . image !
164164 ] ) ;
165165
@@ -185,6 +185,7 @@ describe("Fallback to azure devops access token", () => {
185185 const envVars = ( await getEnvVars ( config ) ) . toString ( ) ;
186186 logger . info (
187187 `spin: ${ envVars } , act: ${
188+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
188189 config . introspection ! . azure ! . source_repo_access_token
189190 } `
190191 ) ;
@@ -198,6 +199,7 @@ describe("Fallback to azure devops access token", () => {
198199 const envVars = ( await getEnvVars ( config ) ) . toString ( ) ;
199200 const expectedSubstring =
200201 "REACT_APP_SOURCE_REPO_ACCESS_TOKEN=" +
202+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
201203 config . introspection ! . azure ! . source_repo_access_token ! ;
202204 expect ( envVars . includes ( expectedSubstring ) ) . toBeTruthy ( ) ;
203205 } ) ;
@@ -206,21 +208,26 @@ describe("Fallback to azure devops access token", () => {
206208describe ( "Extract manifest repository information" , ( ) => {
207209 test ( "Manifest repository information is successfully extracted" , ( ) => {
208210 ( Config as jest . Mock ) . mockReturnValue ( {
209- azure_devops : {
210- manifest_repository :
211+ " azure_devops" : {
212+ " manifest_repository" :
211213 "https://dev.azure.com/bhnook/fabrikam/_git/materialized"
212214 }
213215 } ) ;
214216 const config = Config ( ) ;
215217 let manifestInfo = extractManifestRepositoryInformation ( config ) ;
216218 expect ( manifestInfo ) . toBeDefined ( ) ;
219+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
217220 expect ( manifestInfo ! . githubUsername ) . toBeUndefined ( ) ;
221+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
218222 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" ] =
220225 "https://github.com/username/manifest" ;
221226 manifestInfo = extractManifestRepositoryInformation ( config ) ;
222227 expect ( manifestInfo ) . toBeDefined ( ) ;
228+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
223229 expect ( manifestInfo ! . githubUsername ) . toBe ( "username" ) ;
230+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
224231 expect ( manifestInfo ! . manifestRepoName ) . toBe ( "manifest" ) ;
225232
226233 logger . info ( "Verified that manifest repository extraction works" ) ;
0 commit comments