@itwin/certa
Version:
A mocha-based integration test runner
28 lines • 1.83 kB
TypeScript
import { ChildProcess } from "child_process";
/**
* Helper function for spawning a child process with the same cwd, env, stdout, and stderr as the current process.
* Processes spawned by this function will also have an IPC channel, so the may communicate with their parent via `process.send()`.
* @param command The command to run.
* @param args List of string arguments.
* @param env Environment vars to override in the child process.
* @param useIpc Whether to enable an IPC channel when spawning.
*/
export declare function spawnChildProcess(command: string, args: ReadonlyArray<string>, env?: NodeJS.ProcessEnv, useIpc?: boolean): ChildProcess;
/** Returns a Promise that will be resolved with the given child process's exit code upon termination. */
export declare function onExit(child: ChildProcess): Promise<number>;
/**
* Helper function for relaunching (as a child process) the current process in electron instead of node.
* Returns a promise that will be resolved with the exit code of the child process, once it terminates.
*/
export declare function relaunchInElectron(): Promise<number>;
/**
* Activates the v8 inspector and starts listening on the given port, then breaks as soon as a debugger has connected.
* This is essentially what node does when run with `--inspect-brk={port}`, but doing this manually gives us more control
* over precisely _which_ child process connects to the debugger.
*
* For example, when using the chrome test runner, we want debug the original certa process ("node certa ...args") as the
* test "backend", but with the electron test runner, we want to debug a child process ("electron certa ...args").
* @param port Port to listen on for inspector connections.
*/
export declare function startDebugger(port: number): void;
//# sourceMappingURL=SpawnUtils.d.ts.map