Make getVariantAnalysisRepoResult return the correct type

We expect this method to return a zip file which can be typed to an
`ArrayBuffer`. In the following commits we'll read this buffer and save it
as a zip file.
This commit is contained in:
Elena Tanasoiu
2022-10-10 18:30:27 +01:00
parent 81b53c9c19
commit 69b06ae95c
2 changed files with 4 additions and 7 deletions

View File

@@ -77,12 +77,9 @@ export async function getVariantAnalysisRepo(
export async function getVariantAnalysisRepoResult(
credentials: Credentials,
downloadUrl: string,
): Promise<unknown> {
): Promise<ArrayBuffer> {
const octokit = await credentials.getOctokit();
const response: OctokitResponse<VariantAnalysisRepoTask> = await octokit.request(
`GET ${downloadUrl}`
);
const response = await octokit.request(`GET ${downloadUrl}`);
return response.data;
}

View File

@@ -88,7 +88,7 @@ describe('Variant Analysis Manager', async function() {
delete dummyRepoTask.artifact_url;
getVariantAnalysisRepoStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepo').resolves(dummyRepoTask);
const dummyResult = 'this-is-a-repo-result';
const dummyResult = new ArrayBuffer(24);
getVariantAnalysisRepoResultStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepoResult').resolves(dummyResult);
});
@@ -108,7 +108,7 @@ describe('Variant Analysis Manager', async function() {
const dummyRepoTask = createMockVariantAnalysisRepoTask();
getVariantAnalysisRepoStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepo').resolves(dummyRepoTask);
const dummyResult = 'this-is-a-repo-result';
const dummyResult = new ArrayBuffer(24);
getVariantAnalysisRepoResultStub = sandbox.stub(ghApiClient, 'getVariantAnalysisRepoResult').resolves(dummyResult);
});