Use correct jest-runner-vscode for no-workspace

This commit is contained in:
Koen Vlaswinkel
2022-11-23 10:26:39 +01:00
parent 0296db8b25
commit 90dd97fbc0
2 changed files with 22 additions and 13 deletions

View File

@@ -0,0 +1,20 @@
import * as path from "path";
import * as tmp from "tmp-promise";
import { RunnerOptions } from "jest-runner-vscode";
export const tmpDir = tmp.dirSync({ unsafeCleanup: true });
export const rootDir = path.resolve(__dirname, "../..");
const config: RunnerOptions = {
version: "stable",
launchArgs: [
"--disable-extensions",
"--disable-gpu",
"--disable-workspace-trust",
"--user-data-dir=" + path.join(tmpDir.name, "user-data"),
],
extensionDevelopmentPath: rootDir,
};
export default config;

View File

@@ -1,20 +1,9 @@
import * as path from "path";
import * as tmp from "tmp-promise";
import { RunnerOptions } from "jest-runner-vscode"; import { RunnerOptions } from "jest-runner-vscode";
const tmpDir = tmp.dirSync({ unsafeCleanup: true }); import baseConfig from "../jest-runner-vscode.config.base";
const config: RunnerOptions = { const config: RunnerOptions = {
version: "stable", ...baseConfig,
launchArgs: [
"--disable-extensions",
"--disable-gpu",
"--new-window",
"--user-data-dir=" + path.join(tmpDir.name, "user-data"),
],
workspaceDir: path.resolve(__dirname, "test/data"),
openInFolder: true,
extensionDevelopmentPath: path.resolve(__dirname),
}; };
// We are purposefully not using export default here since that would result in an ESModule, which doesn't seem to be // We are purposefully not using export default here since that would result in an ESModule, which doesn't seem to be