@@ -41,20 +41,44 @@ index 8657ace..4d35409 100644
4141- export default function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig, filterOutput, onStart, onResult, onFailure, ipc, quiet, }: RunVSCodeOptions): Promise<void>;
4242+ export default function runVSCode(options: RunVSCodeOptions): Promise<void>;
4343diff --git a/node_modules/jest-runner-vscode/dist/run-vscode.js b/node_modules/jest-runner-vscode/dist/run-vscode.js
44- index 5d8e513..6edf99a 100644
44+ index 5d8e513..cacbc42 100644
4545--- a/node_modules/jest-runner-vscode/dist/run-vscode.js
4646+++ b/node_modules/jest-runner-vscode/dist/run-vscode.js
47- @@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
47+ @@ -5,8 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4848 Object.defineProperty(exports, "__esModule", { value: true });
4949 const child_process_1 = __importDefault(require("child_process"));
5050 const console_1 = __importDefault(require("console"));
5151- async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig, filterOutput, onStart, onResult, onFailure, ipc, quiet, }) {
52+ - return await new Promise(resolve => {
53+ + const fs_1 = __importDefault(require("fs"));
54+ + const path_1 = __importDefault(require("path"));
55+ + const os_1 = __importDefault(require("os"));
5256+ async function runVSCode(options) {
5357+ const { vscodePath, args, jestArgs, env, tests, globalConfig, filterOutput, onStart, onResult, onFailure, ipc, quiet, attempt, maxRetries, } = options;
54- return await new Promise(resolve => {
58+ + const tempUserDir = await fs_1.default.promises.mkdtemp(path_1.default.resolve(os_1.default.tmpdir(), 'jest-runner-vscode-user-data-'));
59+ + return await new Promise(promiseResolve => {
60+ + const resolve = () => {
61+ + fs_1.default.rm(tempUserDir, { recursive: true }, () => {
62+ + promiseResolve();
63+ + });
64+ + };
5565 const useStdErr = globalConfig.json || globalConfig.useStderr;
5666 const log = useStdErr
57- @@ -101,11 +102,31 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
67+ ? console_1.default.error.bind(console_1.default)
68+ @@ -82,7 +92,11 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
69+ ipc.server.on('stdout', onStdout);
70+ ipc.server.on('stderr', onStderr);
71+ ipc.server.on('error', onError);
72+ - const vscode = child_process_1.default.spawn(vscodePath, args, { env: environment });
73+ + const launchArgs = args;
74+ + if (!hasArg('user-data-dir', launchArgs)) {
75+ + launchArgs.push(`--user-data-dir=${tempUserDir}`);
76+ + }
77+ + const vscode = child_process_1.default.spawn(vscodePath, launchArgs, { env: environment });
78+ if (!silent && !filterOutput) {
79+ vscode.stdout.pipe(process.stdout);
80+ vscode.stderr.pipe(process.stderr);
81+ @@ -101,11 +115,31 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
5882 const message = `VS Code exited with exit code ${exit}`;
5983 if (typeof code !== 'number' || code !== 0) {
6084 silent || quiet || console_1.default.error(message);
@@ -91,6 +115,13 @@ index 5d8e513..6edf99a 100644
91115 }
92116 }
93117 }
118+ @@ -138,3 +172,6 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
119+ });
120+ }
121+ exports.default = runVSCode;
122+ + function hasArg(argName, argList) {
123+ + return argList.some(a => a === `--${argName}` || a.startsWith(`--${argName}=`));
124+ + }
94125diff --git a/node_modules/jest-runner-vscode/dist/runner.js b/node_modules/jest-runner-vscode/dist/runner.js
95126index e24c976..c374022 100644
96127--- a/node_modules/jest-runner-vscode/dist/runner.js
0 commit comments