Retrieve remote configuration where specified

This commit is contained in:
Sam Partington 2020-06-26 09:32:44 +01:00
parent 388403b46e
commit 366d8a32d1
6 changed files with 78 additions and 23 deletions

View file

@ -198,17 +198,21 @@ test("Octokit used when reading remote config", async t => {
- b
paths:
- c/d`;
const dummyResponse = [
{data: inputFileContents}
];
let ok = new octokit.Octokit({
userAgent: "CodeQL Action",
});
const spyRequest = sinon.stub(ok, "request").resolves(inputFileContents);
const repos = ok.repos;
const spyGetContents = sinon.stub(repos, "getContents").resolves(Promise.resolve(dummyResponse));
ok.repos = repos;
sinon.stub(octokit, "Octokit").resolves(ok);
setInput('config-file', 'octo-org/codeql-config/config.yaml@main');
await configUtils.loadConfig();
t.assert(spyRequest.called);
t.assert(spyGetContents.called);
});
});