Do not dispose the extension after every test file

This commit is contained in:
Koen Vlaswinkel
2022-11-24 09:07:40 +01:00
parent 4f8d68d8a2
commit 614785fb7a

View File

@@ -6,7 +6,6 @@ import * as tmp from "tmp";
import { getTestSetting } from "../test-config";
import { CUSTOM_CODEQL_PATH_SETTING } from "../../config";
import { extensions, workspace } from "vscode";
import { CodeQLExtensionInterface } from "../../extension";
import baseJestSetup from "../jest.setup";
@@ -78,21 +77,6 @@ beforeAll(async () => {
// ensure extension is cleaned up.
afterAll(async () => {
const extension = await extensions
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
"GitHub.vscode-codeql",
)!
.activate();
// This shuts down the extension and can only be run after all tests have completed.
// If this is not called, then the test process will hang.
if ("dispose" in extension) {
try {
extension.dispose();
} catch (e) {
console.warn("Failed to dispose extension", e);
}
}
// ensure temp directory is cleaned up.
try {
removeStorage?.();