MCPcopy Create free account
hub / github.com/appium/appium / dyingProcess

Function dyingProcess

packages/execute-driver-plugin/test/unit/plugin.spec.ts:25–33  ·  view source on GitHub ↗

* A child process which ends the given way instead of ever returning a result

(code: number | null, signal: string | null)

Source from the content-addressed store, hash-verified

23 * A child process which ends the given way instead of ever returning a result
24 */
25function dyingProcess(code: number | null, signal: string | null) {
26 const scriptProc = new EventEmitter() as any;
27 scriptProc.connected = false;
28 scriptProc.exitCode = code;
29 scriptProc.kill = () => {};
30 // a real child process cannot exit in the same tick as the message we send to it
31 scriptProc.send = () => setImmediate(() => scriptProc.emit('exit', code, signal));
32 return scriptProc;
33}
34
35async function runScript(scriptProc: any, timeoutMs: number, serverHost?: string) {
36 const originalFork = cp.fork;

Callers 1

plugin.spec.tsFile · 0.85

Calls 1

emitMethod · 0.80

Tested by

no test coverage detected