11import test , { ExecutionContext } from "ava" ;
22
3+ import { RepositoryProperties } from "../feature-flags/properties" ;
34import { KnownLanguage , Language } from "../languages" ;
45import { prettyPrintPack } from "../util" ;
56
@@ -190,11 +191,13 @@ const calculateAugmentationMacro = test.macro({
190191 rawPacksInput : string | undefined ,
191192 rawQueriesInput : string | undefined ,
192193 languages : Language [ ] ,
194+ repositoryProperties : RepositoryProperties ,
193195 expectedAugmentationProperties : dbConfig . AugmentationProperties ,
194196 ) => {
195197 const actualAugmentationProperties = await dbConfig . calculateAugmentation (
196198 rawPacksInput ,
197199 rawQueriesInput ,
200+ repositoryProperties ,
198201 languages ,
199202 ) ;
200203 t . deepEqual ( actualAugmentationProperties , expectedAugmentationProperties ) ;
@@ -208,6 +211,7 @@ test(
208211 undefined ,
209212 undefined ,
210213 [ KnownLanguage . javascript ] ,
214+ { } ,
211215 {
212216 ...dbConfig . defaultAugmentationProperties ,
213217 } ,
@@ -219,6 +223,7 @@ test(
219223 undefined ,
220224 " a, b , c, d" ,
221225 [ KnownLanguage . javascript ] ,
226+ { } ,
222227 {
223228 ...dbConfig . defaultAugmentationProperties ,
224229 queriesInput : [ { uses : "a" } , { uses : "b" } , { uses : "c" } , { uses : "d" } ] ,
@@ -231,6 +236,7 @@ test(
231236 undefined ,
232237 " + a, b , c, d " ,
233238 [ KnownLanguage . javascript ] ,
239+ { } ,
234240 {
235241 ...dbConfig . defaultAugmentationProperties ,
236242 queriesInputCombines : true ,
@@ -244,6 +250,7 @@ test(
244250 " codeql/a , codeql/b , codeql/c , codeql/d " ,
245251 undefined ,
246252 [ KnownLanguage . javascript ] ,
253+ { } ,
247254 {
248255 ...dbConfig . defaultAugmentationProperties ,
249256 packsInput : [ "codeql/a" , "codeql/b" , "codeql/c" , "codeql/d" ] ,
@@ -256,6 +263,7 @@ test(
256263 " + codeql/a, codeql/b, codeql/c, codeql/d" ,
257264 undefined ,
258265 [ KnownLanguage . javascript ] ,
266+ { } ,
259267 {
260268 ...dbConfig . defaultAugmentationProperties ,
261269 packsInputCombines : true ,
@@ -270,13 +278,15 @@ const calculateAugmentationErrorMacro = test.macro({
270278 rawPacksInput : string | undefined ,
271279 rawQueriesInput : string | undefined ,
272280 languages : Language [ ] ,
281+ repositoryProperties : RepositoryProperties ,
273282 expectedError : RegExp | string ,
274283 ) => {
275284 await t . throwsAsync (
276285 ( ) =>
277286 dbConfig . calculateAugmentation (
278287 rawPacksInput ,
279288 rawQueriesInput ,
289+ repositoryProperties ,
280290 languages ,
281291 ) ,
282292 { message : expectedError } ,
@@ -291,6 +301,7 @@ test(
291301 undefined ,
292302 " + " ,
293303 [ KnownLanguage . javascript ] ,
304+ { } ,
294305 / T h e w o r k f l o w p r o p e r t y " q u e r i e s " i s i n v a l i d / ,
295306) ;
296307
@@ -300,6 +311,7 @@ test(
300311 " + " ,
301312 undefined ,
302313 [ KnownLanguage . javascript ] ,
314+ { } ,
303315 / T h e w o r k f l o w p r o p e r t y " p a c k s " i s i n v a l i d / ,
304316) ;
305317
@@ -309,6 +321,7 @@ test(
309321 " + a/b, c/d " ,
310322 undefined ,
311323 [ KnownLanguage . javascript , KnownLanguage . java ] ,
324+ { } ,
312325 / C a n n o t s p e c i f y a ' p a c k s ' i n p u t i n a m u l t i - l a n g u a g e a n a l y s i s / ,
313326) ;
314327
@@ -318,6 +331,7 @@ test(
318331 " + a/b, c/d " ,
319332 undefined ,
320333 [ ] ,
334+ { } ,
321335 / N o l a n g u a g e s s p e c i f i e d / ,
322336) ;
323337
@@ -327,5 +341,6 @@ test(
327341 " a-pack-without-a-scope " ,
328342 undefined ,
329343 [ KnownLanguage . javascript ] ,
344+ { } ,
330345 / " a - p a c k - w i t h o u t - a - s c o p e " i s n o t a v a l i d p a c k / ,
331346) ;
0 commit comments