@@ -110,92 +110,92 @@ describe('DefaultAwsSamDebugConfigurationValidator', function () {
110
110
validator = new DefaultAwsSamDebugConfigurationValidator ( instance ( mockFolder ) )
111
111
} )
112
112
113
- it ( 'returns invalid when resolving debug configurations with an invalid request type' , function ( ) {
113
+ it ( 'returns invalid when resolving debug configurations with an invalid request type' , async ( ) => {
114
114
templateConfig . request = 'not-direct-invoke'
115
115
116
- const result = validator . validate ( templateConfig , mockRegistry )
116
+ const result = await validator . validate ( templateConfig , mockRegistry )
117
117
assert . strictEqual ( result . isValid , false )
118
118
} )
119
119
120
- it ( 'returns invalid when resolving debug configurations with an invalid target type' , function ( ) {
120
+ it ( 'returns invalid when resolving debug configurations with an invalid target type' , async ( ) => {
121
121
templateConfig . invokeTarget . target = 'not-valid' as any
122
122
123
- const result = validator . validate ( templateConfig as any , mockRegistry )
123
+ const result = await validator . validate ( templateConfig as any , mockRegistry )
124
124
assert . strictEqual ( result . isValid , false )
125
125
} )
126
126
127
- it ( "returns invalid when resolving template debug configurations with a template that isn't in the registry" , ( ) => {
127
+ it ( "returns invalid when resolving template debug configurations with a template that isn't in the registry" , async ( ) => {
128
128
const mockEmptyRegistry : CloudFormationTemplateRegistry = mock ( )
129
129
when ( mockEmptyRegistry . getItem ( '/' ) ) . thenReturn ( undefined )
130
130
131
131
validator = new DefaultAwsSamDebugConfigurationValidator ( instance ( mockFolder ) )
132
132
133
- const result = validator . validate ( templateConfig , mockRegistry )
133
+ const result = await validator . validate ( templateConfig , mockRegistry )
134
134
assert . strictEqual ( result . isValid , false )
135
135
} )
136
136
137
- it ( "returns invalid when resolving template debug configurations with a template that doesn't have the set resource" , ( ) => {
137
+ it ( "returns invalid when resolving template debug configurations with a template that doesn't have the set resource" , async ( ) => {
138
138
const target = templateConfig . invokeTarget as TemplateTargetProperties
139
139
target . logicalId = 'wrong'
140
140
141
- const result = validator . validate ( templateConfig , mockRegistry )
141
+ const result = await validator . validate ( templateConfig , mockRegistry )
142
142
assert . strictEqual ( result . isValid , false )
143
143
} )
144
144
145
- it ( "returns invalid when resolving template debug configurations with a template that isn't serverless" , ( ) => {
145
+ it ( "returns invalid when resolving template debug configurations with a template that isn't serverless" , async ( ) => {
146
146
const target = templateConfig . invokeTarget as TemplateTargetProperties
147
147
target . logicalId = 'OtherResource'
148
148
149
- const result = validator . validate ( templateConfig , mockRegistry )
149
+ const result = await validator . validate ( templateConfig , mockRegistry )
150
150
assert . strictEqual ( result . isValid , false )
151
151
} )
152
152
153
- it ( 'returns undefined when resolving template debug configurations with a resource that has an invalid runtime in template' , function ( ) {
153
+ it ( 'returns undefined when resolving template debug configurations with a resource that has an invalid runtime in template' , async ( ) => {
154
154
const properties = templateData . item . Resources ?. TestResource ?. Properties as CloudFormation . ZipResourceProperties
155
155
properties . Runtime = 'invalid'
156
156
157
- const result = validator . validate ( templateConfig , mockRegistry )
157
+ const result = await validator . validate ( templateConfig , mockRegistry )
158
158
assert . strictEqual ( result . isValid , false )
159
159
} )
160
160
161
- it ( "API config returns invalid when resolving with a template that isn't serverless" , ( ) => {
161
+ it ( "API config returns invalid when resolving with a template that isn't serverless" , async ( ) => {
162
162
const target = templateConfig . invokeTarget as TemplateTargetProperties
163
163
target . logicalId = 'OtherResource'
164
164
165
- const result = validator . validate ( apiConfig , mockRegistry )
165
+ const result = await validator . validate ( apiConfig , mockRegistry )
166
166
assert . strictEqual ( result . isValid , false )
167
167
} )
168
168
169
- it ( 'API config is invalid when it does not have an API field' , function ( ) {
169
+ it ( 'API config is invalid when it does not have an API field' , async ( ) => {
170
170
const config = createApiConfig ( )
171
171
config . api = undefined
172
172
173
- const result = validator . validate ( config , mockRegistry )
173
+ const result = await validator . validate ( config , mockRegistry )
174
174
assert . strictEqual ( result . isValid , false )
175
175
} )
176
176
177
- it ( "API config is invalid when its path does not start with a '/'" , ( ) => {
177
+ it ( "API config is invalid when its path does not start with a '/'" , async ( ) => {
178
178
const config = createApiConfig ( )
179
179
180
180
config . api ! . path = 'noleadingslash'
181
181
182
- const result = validator . validate ( config , mockRegistry )
182
+ const result = await validator . validate ( config , mockRegistry )
183
183
assert . strictEqual ( result . isValid , false )
184
184
} )
185
185
186
- it ( 'returns invalid when resolving code debug configurations with invalid runtimes' , function ( ) {
186
+ it ( 'returns invalid when resolving code debug configurations with invalid runtimes' , async ( ) => {
187
187
codeConfig . lambda = { runtime : 'asd' }
188
188
189
- const result = validator . validate ( codeConfig , mockRegistry )
189
+ const result = await validator . validate ( codeConfig , mockRegistry )
190
190
assert . strictEqual ( result . isValid , false )
191
191
} )
192
192
193
- it ( 'returns invalid when Image app does not declare runtime' , function ( ) {
193
+ it ( 'returns invalid when Image app does not declare runtime' , async ( ) => {
194
194
const lambda = imageTemplateConfig . lambda
195
195
196
196
delete lambda ?. runtime
197
197
198
- const result = validator . validate ( templateConfig , mockRegistry )
198
+ const result = await validator . validate ( templateConfig , mockRegistry )
199
199
assert . strictEqual ( result . isValid , false )
200
200
} )
201
201
} )
0 commit comments