@@ -131,16 +131,6 @@ test("load empty config", async (t) => {
131
131
const languages = "javascript,python" ;
132
132
133
133
const codeql = setCodeQL ( {
134
- async resolveQueries ( ) {
135
- return {
136
- byLanguage : {
137
- javascript : { queries : [ "query1.ql" ] } ,
138
- python : { queries : [ "query2.ql" ] } ,
139
- } ,
140
- noDeclaredLanguage : { } ,
141
- multipleDeclaredLanguages : { } ,
142
- } ;
143
- } ,
144
134
async packDownload ( ) : Promise < PackDownloadOutput > {
145
135
return { packs : [ ] } ;
146
136
} ,
@@ -175,16 +165,6 @@ test("loading config saves config", async (t) => {
175
165
const logger = getRunnerLogger ( true ) ;
176
166
177
167
const codeql = setCodeQL ( {
178
- async resolveQueries ( ) {
179
- return {
180
- byLanguage : {
181
- javascript : { queries : [ "query1.ql" ] } ,
182
- python : { queries : [ "query2.ql" ] } ,
183
- } ,
184
- noDeclaredLanguage : { } ,
185
- multipleDeclaredLanguages : { } ,
186
- } ;
187
- } ,
188
168
async packDownload ( ) : Promise < PackDownloadOutput > {
189
169
return { packs : [ ] } ;
190
170
} ,
@@ -306,18 +286,6 @@ test("load non-existent input", async (t) => {
306
286
test ( "load non-empty input" , async ( t ) => {
307
287
return await withTmpDir ( async ( tempDir ) => {
308
288
const codeql = setCodeQL ( {
309
- async resolveQueries ( ) {
310
- return {
311
- byLanguage : {
312
- javascript : {
313
- "/foo/a.ql" : { } ,
314
- "/bar/b.ql" : { } ,
315
- } ,
316
- } ,
317
- noDeclaredLanguage : { } ,
318
- multipleDeclaredLanguages : { } ,
319
- } ;
320
- } ,
321
289
async packDownload ( ) : Promise < PackDownloadOutput > {
322
290
return { packs : [ ] } ;
323
291
} ,
@@ -382,25 +350,6 @@ test("load non-empty input", async (t) => {
382
350
} ) ;
383
351
} ) ;
384
352
385
- /**
386
- * Returns the provided queries, just in the right format for a resolved query
387
- * This way we can test by seeing which returned items are in the final
388
- * configuration.
389
- */
390
- function queriesToResolvedQueryForm ( queries : string [ ] ) {
391
- const dummyResolvedQueries = { } ;
392
- for ( const q of queries ) {
393
- dummyResolvedQueries [ q ] = { } ;
394
- }
395
- return {
396
- byLanguage : {
397
- javascript : dummyResolvedQueries ,
398
- } ,
399
- noDeclaredLanguage : { } ,
400
- multipleDeclaredLanguages : { } ,
401
- } ;
402
- }
403
-
404
353
test ( "Using config input and file together, config input should be used." , async ( t ) => {
405
354
return await withTmpDir ( async ( tempDir ) => {
406
355
process . env [ "RUNNER_TEMP" ] = tempDir ;
@@ -425,18 +374,7 @@ test("Using config input and file together, config input should be used.", async
425
374
426
375
fs . mkdirSync ( path . join ( tempDir , "foo" ) ) ;
427
376
428
- const resolveQueriesArgs : Array < {
429
- queries : string [ ] ;
430
- extraSearchPath : string | undefined ;
431
- } > = [ ] ;
432
377
const codeql = setCodeQL ( {
433
- async resolveQueries (
434
- queries : string [ ] ,
435
- extraSearchPath : string | undefined ,
436
- ) {
437
- resolveQueriesArgs . push ( { queries, extraSearchPath } ) ;
438
- return queriesToResolvedQueryForm ( queries ) ;
439
- } ,
440
378
async packDownload ( ) : Promise < PackDownloadOutput > {
441
379
return { packs : [ ] } ;
442
380
} ,
@@ -463,17 +401,6 @@ test("Using config input and file together, config input should be used.", async
463
401
test ( "API client used when reading remote config" , async ( t ) => {
464
402
return await withTmpDir ( async ( tempDir ) => {
465
403
const codeql = setCodeQL ( {
466
- async resolveQueries ( ) {
467
- return {
468
- byLanguage : {
469
- javascript : {
470
- "foo.ql" : { } ,
471
- } ,
472
- } ,
473
- noDeclaredLanguage : { } ,
474
- multipleDeclaredLanguages : { } ,
475
- } ;
476
- } ,
477
404
async packDownload ( ) : Promise < PackDownloadOutput > {
478
405
return { packs : [ ] } ;
479
406
} ,
0 commit comments