Fix async describes
This commit is contained in:
@@ -57,7 +57,7 @@ import {
|
||||
// up to 3 minutes per test
|
||||
jest.setTimeout(3 * 60 * 1000);
|
||||
|
||||
describe("Variant Analysis Manager", async () => {
|
||||
describe("Variant Analysis Manager", () => {
|
||||
const pathExistsStub = jest.spyOn(fs, "pathExists");
|
||||
const readJsonStub = jest.spyOn(fs, "readJson");
|
||||
const outputJsonStub = jest.spyOn(fs, "outputJson");
|
||||
@@ -405,7 +405,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when credentials are invalid", async () => {
|
||||
describe("when credentials are invalid", () => {
|
||||
beforeEach(async () => {
|
||||
jest
|
||||
.spyOn(Credentials, "initialize")
|
||||
@@ -425,7 +425,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when credentials are valid", async () => {
|
||||
describe("when credentials are valid", () => {
|
||||
let arrayBuffer: ArrayBuffer;
|
||||
|
||||
const getVariantAnalysisRepoStub = jest.spyOn(
|
||||
@@ -456,7 +456,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
getVariantAnalysisRepoResultStub.mockReset();
|
||||
});
|
||||
|
||||
describe("when the artifact_url is missing", async () => {
|
||||
describe("when the artifact_url is missing", () => {
|
||||
beforeEach(async () => {
|
||||
const dummyRepoTask = createMockVariantAnalysisRepoTask();
|
||||
delete dummyRepoTask.artifact_url;
|
||||
@@ -476,7 +476,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the artifact_url is present", async () => {
|
||||
describe("when the artifact_url is present", () => {
|
||||
let dummyRepoTask: VariantAnalysisRepoTask;
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -486,7 +486,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
getVariantAnalysisRepoResultStub.mockResolvedValue(arrayBuffer);
|
||||
});
|
||||
|
||||
describe("autoDownloadVariantAnalysisResult", async () => {
|
||||
describe("autoDownloadVariantAnalysisResult", () => {
|
||||
it("should return early if variant analysis is cancelled", async () => {
|
||||
cancellationTokenSource.cancel();
|
||||
|
||||
@@ -754,7 +754,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("enqueueDownload", async () => {
|
||||
describe("enqueueDownload", () => {
|
||||
it("should pop download tasks off the queue", async () => {
|
||||
const getResultsSpy = jest.spyOn(
|
||||
variantAnalysisManager,
|
||||
@@ -782,7 +782,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("removeVariantAnalysis", async () => {
|
||||
describe("removeVariantAnalysis", () => {
|
||||
const removeAnalysisResultsStub = jest.spyOn(
|
||||
variantAnalysisResultsManager,
|
||||
"removeAnalysisResults",
|
||||
@@ -814,7 +814,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when rehydrating a query", async () => {
|
||||
describe("when rehydrating a query", () => {
|
||||
let variantAnalysis: VariantAnalysis;
|
||||
const variantAnalysisRemovedSpy = jest.fn();
|
||||
const executeCommandSpy = jest.spyOn(commands, "executeCommand");
|
||||
@@ -830,7 +830,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
executeCommandSpy.mockReset().mockResolvedValue(undefined);
|
||||
});
|
||||
|
||||
describe("when variant analysis record doesn't exist", async () => {
|
||||
describe("when variant analysis record doesn't exist", () => {
|
||||
it("should remove the variant analysis", async () => {
|
||||
await variantAnalysisManager.rehydrateVariantAnalysis(variantAnalysis);
|
||||
expect(variantAnalysisRemovedSpy).toHaveBeenCalledTimes(1);
|
||||
@@ -842,7 +842,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when variant analysis record does exist", async () => {
|
||||
describe("when variant analysis record does exist", () => {
|
||||
let variantAnalysisStorageLocation: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -857,7 +857,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
fs.rmSync(variantAnalysisStorageLocation, { recursive: true });
|
||||
});
|
||||
|
||||
describe("when the variant analysis is not complete", async () => {
|
||||
describe("when the variant analysis is not complete", () => {
|
||||
beforeEach(() => {
|
||||
jest
|
||||
.spyOn(VariantAnalysisModule, "isVariantAnalysisComplete")
|
||||
@@ -882,7 +882,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the variant analysis is complete", async () => {
|
||||
describe("when the variant analysis is complete", () => {
|
||||
beforeEach(() => {
|
||||
jest
|
||||
.spyOn(VariantAnalysisModule, "isVariantAnalysisComplete")
|
||||
@@ -906,7 +906,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("cancelVariantAnalysis", async () => {
|
||||
describe("cancelVariantAnalysis", () => {
|
||||
let variantAnalysis: VariantAnalysis;
|
||||
const mockCancelVariantAnalysis = jest.spyOn(
|
||||
ghActionsApiClient,
|
||||
@@ -1005,7 +1005,7 @@ describe("Variant Analysis Manager", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("copyRepoListToClipboard", async () => {
|
||||
describe("copyRepoListToClipboard", () => {
|
||||
let variantAnalysis: VariantAnalysis;
|
||||
let variantAnalysisStorageLocation: string;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import { VariantAnalysisManager } from "../../../remote-queries/variant-analysis
|
||||
|
||||
jest.setTimeout(60_000);
|
||||
|
||||
describe("Variant Analysis Monitor", async () => {
|
||||
describe("Variant Analysis Monitor", () => {
|
||||
let extension: CodeQLExtensionInterface | Record<string, never>;
|
||||
const mockGetVariantAnalysis = jest.spyOn(ghApiClient, "getVariantAnalysis");
|
||||
let cancellationTokenSource: CancellationTokenSource;
|
||||
@@ -83,7 +83,7 @@ describe("Variant Analysis Monitor", async () => {
|
||||
limitNumberOfAttemptsToMonitor();
|
||||
});
|
||||
|
||||
describe("when credentials are invalid", async () => {
|
||||
describe("when credentials are invalid", () => {
|
||||
beforeEach(async () => {
|
||||
jest
|
||||
.spyOn(Credentials, "initialize")
|
||||
@@ -102,7 +102,7 @@ describe("Variant Analysis Monitor", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when credentials are valid", async () => {
|
||||
describe("when credentials are valid", () => {
|
||||
beforeEach(async () => {
|
||||
const mockCredentials = {
|
||||
getOctokit: () =>
|
||||
@@ -124,7 +124,7 @@ describe("Variant Analysis Monitor", async () => {
|
||||
expect(result).toEqual({ status: "Canceled" });
|
||||
});
|
||||
|
||||
describe("when the variant analysis fails", async () => {
|
||||
describe("when the variant analysis fails", () => {
|
||||
let mockFailedApiResponse: VariantAnalysisApiResponse;
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -163,12 +163,12 @@ describe("Variant Analysis Monitor", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the variant analysis is in progress", async () => {
|
||||
describe("when the variant analysis is in progress", () => {
|
||||
let mockApiResponse: VariantAnalysisApiResponse;
|
||||
let scannedRepos: ApiVariantAnalysisScannedRepository[];
|
||||
let succeededRepos: ApiVariantAnalysisScannedRepository[];
|
||||
|
||||
describe("when there are successfully scanned repos", async () => {
|
||||
describe("when there are successfully scanned repos", () => {
|
||||
beforeEach(async () => {
|
||||
scannedRepos = createMockScannedRepos([
|
||||
"pending",
|
||||
@@ -241,7 +241,7 @@ describe("Variant Analysis Monitor", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when there are only in progress repos", async () => {
|
||||
describe("when there are only in progress repos", () => {
|
||||
let scannedRepos: ApiVariantAnalysisScannedRepository[];
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -270,7 +270,7 @@ describe("Variant Analysis Monitor", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when there are no repos to scan", async () => {
|
||||
describe("when there are no repos to scan", () => {
|
||||
beforeEach(async () => {
|
||||
scannedRepos = [];
|
||||
mockApiResponse = createMockApiResponse("succeeded", scannedRepos);
|
||||
|
||||
@@ -85,7 +85,7 @@ describe(VariantAnalysisResultsManager.name, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the artifact_url is missing", async () => {
|
||||
describe("when the artifact_url is missing", () => {
|
||||
it("should not try to download the result", async () => {
|
||||
const dummyRepoTask = createMockVariantAnalysisRepositoryTask();
|
||||
delete dummyRepoTask.artifactUrl;
|
||||
@@ -105,7 +105,7 @@ describe(VariantAnalysisResultsManager.name, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the artifact_url is present", async () => {
|
||||
describe("when the artifact_url is present", () => {
|
||||
let arrayBuffer: ArrayBuffer;
|
||||
|
||||
const getVariantAnalysisRepoResultStub = jest.spyOn(
|
||||
|
||||
Reference in New Issue
Block a user