11import * as path from "path" ;
2- import { config , loadConfiguration } from "./../init " ;
2+ import { Config , loadConfiguration } from ".. /../config " ;
33import { isValidConfig , isValidStorageAccount } from "./validate" ;
44
55import { StorageManagementClient } from "@azure/arm-storage" ;
@@ -55,7 +55,7 @@ describe("Validate deployment configuration", () => {
5555
5656describe ( "Validate missing deployment configuration" , ( ) => {
5757 test ( "no deployment configuration" , async ( ) => {
58- config . introspection = undefined ;
58+ Config ( ) . introspection = undefined ;
5959 const isValid = isValidConfig ( ) ;
6060
6161 expect ( isValid ) . toBe ( false ) ;
@@ -64,7 +64,7 @@ describe("Validate missing deployment configuration", () => {
6464
6565describe ( "Validate missing deployment.storage configuration" , ( ) => {
6666 test ( "missing deployment.storage" , async ( ) => {
67- config . introspection ! . azure = undefined ;
67+ Config ( ) . introspection ! . azure = undefined ;
6868 const isValid = isValidConfig ( ) ;
6969
7070 expect ( isValid ) . toBe ( false ) ;
@@ -73,7 +73,7 @@ describe("Validate missing deployment.storage configuration", () => {
7373
7474describe ( "Validate missing deployment.storage configuration" , ( ) => {
7575 test ( "missing deployment.storage.account_name configuration" , async ( ) => {
76- config . introspection ! . azure ! . account_name = undefined ;
76+ Config ( ) . introspection ! . azure ! . account_name = undefined ;
7777 const isValid = isValidConfig ( ) ;
7878
7979 expect ( isValid ) . toBe ( false ) ;
@@ -82,7 +82,7 @@ describe("Validate missing deployment.storage configuration", () => {
8282
8383describe ( "Validate missing deployment.storage configuration" , ( ) => {
8484 test ( "missing deployment.storage.table_name configuration" , async ( ) => {
85- config . introspection ! . azure ! . table_name = undefined ;
85+ Config ( ) . introspection ! . azure ! . table_name = undefined ;
8686 const isValid = isValidConfig ( ) ;
8787
8888 expect ( isValid ) . toBe ( false ) ;
@@ -91,7 +91,7 @@ describe("Validate missing deployment.storage configuration", () => {
9191
9292describe ( "Validate missing deployment.storage configuration" , ( ) => {
9393 test ( "missing deployment.storage.partition_key configuration" , async ( ) => {
94- config . introspection ! . azure ! . partition_key = undefined ;
94+ Config ( ) . introspection ! . azure ! . partition_key = undefined ;
9595 const isValid = isValidConfig ( ) ;
9696
9797 expect ( isValid ) . toBe ( false ) ;
@@ -100,7 +100,7 @@ describe("Validate missing deployment.storage configuration", () => {
100100
101101describe ( "Validate missing deployment.storage configuration" , ( ) => {
102102 test ( "missing deployment.storage.key configuration" , async ( ) => {
103- config . introspection ! . azure ! . key = undefined ;
103+ Config ( ) . introspection ! . azure ! . key = undefined ;
104104 const isValid = isValidConfig ( ) ;
105105
106106 expect ( isValid ) . toBe ( false ) ;
@@ -109,7 +109,7 @@ describe("Validate missing deployment.storage configuration", () => {
109109
110110describe ( "Validate missing deployment.pipeline configuration" , ( ) => {
111111 test ( "missing deployment.pipeline configuration" , async ( ) => {
112- config . azure_devops = undefined ;
112+ Config ( ) . azure_devops = undefined ;
113113 const isValid = isValidConfig ( ) ;
114114
115115 expect ( isValid ) . toBe ( false ) ;
@@ -118,7 +118,7 @@ describe("Validate missing deployment.pipeline configuration", () => {
118118
119119describe ( "Validate missing deployment.pipeline configuration" , ( ) => {
120120 test ( "missing deployment.pipeline.org configuration" , async ( ) => {
121- config . azure_devops ! . org = undefined ;
121+ Config ( ) . azure_devops ! . org = undefined ;
122122 const isValid = isValidConfig ( ) ;
123123
124124 expect ( isValid ) . toBe ( false ) ;
@@ -127,7 +127,7 @@ describe("Validate missing deployment.pipeline configuration", () => {
127127
128128describe ( "Validate missing deployment.pipeline configuration" , ( ) => {
129129 test ( "missing deployment.pipeline.project configuration" , async ( ) => {
130- config . azure_devops ! . project = undefined ;
130+ Config ( ) . azure_devops ! . project = undefined ;
131131 const isValid = isValidConfig ( ) ;
132132
133133 expect ( isValid ) . toBe ( false ) ;
@@ -136,30 +136,30 @@ describe("Validate missing deployment.pipeline configuration", () => {
136136
137137describe ( "Validate storage account" , ( ) => {
138138 test ( "non-existing storage account" , async ( ) => {
139- config . introspection ! . azure ! . account_name = "non-existing-account-name" ;
139+ Config ( ) . introspection ! . azure ! . account_name = "non-existing-account-name" ;
140140 const isValid = await isValidStorageAccount ( ) ;
141141
142142 expect ( isValid ) . toBe ( false ) ;
143143 } ) ;
144144
145145 test ( "existing storage account no keys" , async ( ) => {
146- config . introspection ! . azure ! . account_name = "epi-test-no-keys" ;
146+ Config ( ) . introspection ! . azure ! . account_name = "epi-test-no-keys" ;
147147 const isValid = await isValidStorageAccount ( ) ;
148148
149149 expect ( isValid ) . toBe ( false ) ;
150150 } ) ;
151151
152152 test ( "existing storage account with valid key" , async ( ) => {
153- config . introspection ! . azure ! . account_name = "epi-test" ;
154- config . introspection ! . azure ! . key = "mock access key2" ;
153+ Config ( ) . introspection ! . azure ! . account_name = "epi-test" ;
154+ Config ( ) . introspection ! . azure ! . key = "mock access key2" ;
155155 const isValid = await isValidStorageAccount ( ) ;
156156
157157 expect ( isValid ) . toBe ( true ) ;
158158 } ) ;
159159
160160 test ( "existing storage account with invalid key" , async ( ) => {
161- config . introspection ! . azure ! . account_name = "epi-test" ;
162- config . introspection ! . azure ! . key = "mock access key3" ;
161+ Config ( ) . introspection ! . azure ! . account_name = "epi-test" ;
162+ Config ( ) . introspection ! . azure ! . key = "mock access key3" ;
163163 const isValid = await isValidStorageAccount ( ) ;
164164
165165 expect ( isValid ) . toBe ( false ) ;
0 commit comments