Add a note regarding the sinon workaround

This commit is contained in:
Henry Mercer
2023-01-10 19:43:23 +00:00
parent 9f8ddbdfd7
commit 28a9b2d6d7
3 changed files with 9 additions and 1 deletions

View File

@@ -360,6 +360,10 @@ test("download codeql bundle from github ae endpoint", async (t) => {
path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`)
);
// This is a workaround to mock `api.getApiDetails()` since it doesn't seem to be possible to
// mock this directly. The difficulty is that `getApiDetails()` is called locally in
// `api-client.ts`, but `sinon.stub(api, "getApiDetails")` only affects calls to
// `getApiDetails()` via an imported `api` module.
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("token")