mirror of
https://github.com/github/codeql-action.git
synced 2026-05-04 04:40:09 +00:00
fix some of the tests
This commit is contained in:
Generated
+7
-2
@@ -150,7 +150,8 @@ ava_1.default("load non-empty input", async (t) => {
|
||||
content: Buffer.from(inputFileContents).toString("base64"),
|
||||
};
|
||||
const spyGetContents = mockGetContents(dummyResponse);
|
||||
fs.mkdirSync(path.join(tmpDir, 'foo'));
|
||||
// Create checkout directory for remote queries repository
|
||||
fs.mkdirSync(path.join(tmpDir, 'octo-org/codeql-config'), { recursive: true });
|
||||
// And the config we expect it to parse to
|
||||
const expectedConfig = {
|
||||
languages: ['javascript'],
|
||||
@@ -224,6 +225,8 @@ ava_1.default("API client used when reading remote config", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
process.env['GITHUB_REPOSITORY'] = 'foo/bar';
|
||||
process.env['GITHUB_REF'] = 'master';
|
||||
CodeQL.setCodeQL({
|
||||
resolveQueries: async function () {
|
||||
return {
|
||||
@@ -331,7 +334,7 @@ function doInvalidInputTest(testName, inputFileContents, expectedErrorMessageGen
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
process.env['GITHUB_REPOSITORY'] = "octo-org/codeql-config";
|
||||
process.env["GITHUB_REF"] = "refs/heads/main";
|
||||
process.env["GITHUB_REF"] = "master";
|
||||
CodeQL.setCodeQL({
|
||||
resolveQueries: async function () {
|
||||
return {
|
||||
@@ -345,6 +348,8 @@ function doInvalidInputTest(testName, inputFileContents, expectedErrorMessageGen
|
||||
content: Buffer.from(inputFileContents).toString("base64"),
|
||||
};
|
||||
const spyGetContents = mockGetContents(dummyResponse);
|
||||
// Create checkout directory for remote queries repository
|
||||
fs.mkdirSync(path.join(tmpDir, 'octo-org/codeql-config'), { recursive: true });
|
||||
setInput('config-file', 'input');
|
||||
setInput('languages', 'javascript');
|
||||
try {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -165,7 +165,8 @@ test("load non-empty input", async t => {
|
||||
};
|
||||
const spyGetContents = mockGetContents(dummyResponse);
|
||||
|
||||
fs.mkdirSync(path.join(tmpDir, 'foo'));
|
||||
// Create checkout directory for remote queries repository
|
||||
fs.mkdirSync(path.join(tmpDir, 'octo-org/codeql-config'), { recursive: true });
|
||||
|
||||
// And the config we expect it to parse to
|
||||
const expectedConfig: configUtils.Config = {
|
||||
@@ -252,6 +253,8 @@ test("API client used when reading remote config", async t => {
|
||||
return await util.withTmpDir(async tmpDir => {
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
process.env['GITHUB_REPOSITORY'] = 'foo/bar';
|
||||
process.env['GITHUB_REF'] = 'master';
|
||||
|
||||
CodeQL.setCodeQL({
|
||||
resolveQueries: async function() {
|
||||
@@ -377,7 +380,7 @@ function doInvalidInputTest(
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
process.env['GITHUB_REPOSITORY'] = "octo-org/codeql-config";
|
||||
process.env["GITHUB_REF"] = "refs/heads/main";
|
||||
process.env["GITHUB_REF"] = "master";
|
||||
|
||||
CodeQL.setCodeQL({
|
||||
resolveQueries: async function() {
|
||||
@@ -394,6 +397,9 @@ function doInvalidInputTest(
|
||||
};
|
||||
const spyGetContents = mockGetContents(dummyResponse);
|
||||
|
||||
// Create checkout directory for remote queries repository
|
||||
fs.mkdirSync(path.join(tmpDir, 'octo-org/codeql-config'), { recursive: true });
|
||||
|
||||
setInput('config-file', 'input');
|
||||
setInput('languages', 'javascript');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user