mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Tidy up test
This commit is contained in:
8
lib/config-utils.test.js
generated
8
lib/config-utils.test.js
generated
@@ -224,7 +224,7 @@ ava_1.default("default queries are used", async (t) => {
|
||||
t.deepEqual(resolveQueriesArgs[0].extraSearchPath, undefined);
|
||||
});
|
||||
});
|
||||
ava_1.default("Queries can be overridden in action file", async (t) => {
|
||||
ava_1.default("Default queries and those from config file can be overridden in action file", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
@@ -232,7 +232,9 @@ ava_1.default("Queries can be overridden in action file", async (t) => {
|
||||
name: my config
|
||||
queries:
|
||||
- uses: ./foo`;
|
||||
// This config item should take precedence.
|
||||
fs.writeFileSync(path.join(tmpDir, 'input'), inputFileContents, 'utf8');
|
||||
setInput('config-file', 'input');
|
||||
// This config item should take precedence over the config file and the default queries.
|
||||
setInput('queries', './override');
|
||||
fs.mkdirSync(path.join(tmpDir, 'foo'));
|
||||
fs.mkdirSync(path.join(tmpDir, 'override'));
|
||||
@@ -254,8 +256,6 @@ ava_1.default("Queries can be overridden in action file", async (t) => {
|
||||
};
|
||||
},
|
||||
});
|
||||
fs.writeFileSync(path.join(tmpDir, 'input'), inputFileContents, 'utf8');
|
||||
setInput('config-file', 'input');
|
||||
setInput('languages', 'javascript');
|
||||
const config = await configUtils.initConfig();
|
||||
// Check resolveQueries was called correctly
|
||||
|
||||
Reference in New Issue
Block a user