@@ -131,16 +131,6 @@ test("load empty config", async (t) => {
131131 const languages = "javascript,python" ;
132132
133133 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- } ,
144134 async packDownload ( ) : Promise < PackDownloadOutput > {
145135 return { packs : [ ] } ;
146136 } ,
@@ -175,16 +165,6 @@ test("loading config saves config", async (t) => {
175165 const logger = getRunnerLogger ( true ) ;
176166
177167 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- } ,
188168 async packDownload ( ) : Promise < PackDownloadOutput > {
189169 return { packs : [ ] } ;
190170 } ,
@@ -306,18 +286,6 @@ test("load non-existent input", async (t) => {
306286test ( "load non-empty input" , async ( t ) => {
307287 return await withTmpDir ( async ( tempDir ) => {
308288 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- } ,
321289 async packDownload ( ) : Promise < PackDownloadOutput > {
322290 return { packs : [ ] } ;
323291 } ,
@@ -382,25 +350,6 @@ test("load non-empty input", async (t) => {
382350 } ) ;
383351} ) ;
384352
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-
404353test ( "Using config input and file together, config input should be used." , async ( t ) => {
405354 return await withTmpDir ( async ( tempDir ) => {
406355 process . env [ "RUNNER_TEMP" ] = tempDir ;
@@ -425,18 +374,7 @@ test("Using config input and file together, config input should be used.", async
425374
426375 fs . mkdirSync ( path . join ( tempDir , "foo" ) ) ;
427376
428- const resolveQueriesArgs : Array < {
429- queries : string [ ] ;
430- extraSearchPath : string | undefined ;
431- } > = [ ] ;
432377 const codeql = setCodeQL ( {
433- async resolveQueries (
434- queries : string [ ] ,
435- extraSearchPath : string | undefined ,
436- ) {
437- resolveQueriesArgs . push ( { queries, extraSearchPath } ) ;
438- return queriesToResolvedQueryForm ( queries ) ;
439- } ,
440378 async packDownload ( ) : Promise < PackDownloadOutput > {
441379 return { packs : [ ] } ;
442380 } ,
@@ -463,17 +401,6 @@ test("Using config input and file together, config input should be used.", async
463401test ( "API client used when reading remote config" , async ( t ) => {
464402 return await withTmpDir ( async ( tempDir ) => {
465403 const codeql = setCodeQL ( {
466- async resolveQueries ( ) {
467- return {
468- byLanguage : {
469- javascript : {
470- "foo.ql" : { } ,
471- } ,
472- } ,
473- noDeclaredLanguage : { } ,
474- multipleDeclaredLanguages : { } ,
475- } ;
476- } ,
477404 async packDownload ( ) : Promise < PackDownloadOutput > {
478405 return { packs : [ ] } ;
479406 } ,
0 commit comments