fix after review from @henrymercer

This commit is contained in:
tgrall 2023-04-18 05:43:21 +02:00
parent fc374f5e9a
commit f398a65921
7 changed files with 39 additions and 37 deletions

View file

@ -495,9 +495,9 @@ function queriesToResolvedQueryForm(queries) {
t.true(config.queries["javascript"].custom[2].queries[0].endsWith(`${path.sep}foo`));
});
});
(0, ava_1.default)("Queries can be specified in configuration, same as file", async (t) => {
(0, ava_1.default)("Queries can be specified using config input", async (t) => {
return await util.withTmpDir(async (tmpDir) => {
const inputFileContents = `
const configInput = `
name: my config
queries:
- uses: ./foo
@ -520,7 +520,7 @@ function queriesToResolvedQueryForm(queries) {
});
// Only JS, python packs will be ignored
const languages = "javascript";
const config = await configUtils.initConfig(languages, undefined, undefined, undefined, undefined, undefined, inputFileContents, false, false, "", "", { owner: "github", repo: "example " }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));
const config = await configUtils.initConfig(languages, undefined, undefined, undefined, undefined, undefined, configInput, false, false, "", "", { owner: "github", repo: "example " }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));
// Check resolveQueries was called correctly
// It'll be called once for the default queries
// and once for `./foo` from the config file.