Mock env.openExternal instead of overriding it

This commit is contained in:
Koen Vlaswinkel
2023-02-03 11:29:29 +01:00
parent cac0add788
commit beb0058365
2 changed files with 4 additions and 8 deletions

View File

@@ -12,10 +12,6 @@ import { CUSTOM_CODEQL_PATH_SETTING } from "../../../src/config";
import { ConfigurationTarget, env, extensions, workspace } from "vscode";
import { beforeEachAction } from "../test-config";
(env as any).openExternal = () => {
/**/
};
// create an extension storage location
let removeStorage: tmp.DirResult["removeCallback"] | undefined;
@@ -80,6 +76,8 @@ beforeAll(async () => {
});
beforeEach(async () => {
jest.spyOn(env, "openExternal").mockResolvedValue(false);
await beforeEachAction();
await CUSTOM_CODEQL_PATH_SETTING.updateValue(

View File

@@ -1,10 +1,8 @@
import { env } from "vscode";
import { beforeEachAction } from "./test-config";
(env as any).openExternal = () => {
/**/
};
beforeEach(async () => {
jest.spyOn(env, "openExternal").mockResolvedValue(false);
await beforeEachAction();
});