MCPcopy Create free account
hub / github.com/vercel/vercel / fakeChildFailure

Function fakeChildFailure

packages/container/test/unit.test.ts:88–100  ·  view source on GitHub ↗

Fake child process that exits with a failure code.

(stderr = '')

Source from the content-addressed store, hash-verified

86
87/** Fake child process that exits with a failure code. */
88function fakeChildFailure(stderr = '') {
89 const child: any = new EventEmitter();
90 child.stdout = new EventEmitter();
91 child.stderr = new EventEmitter();
92 child.stdin = { end: vi.fn() };
93 setImmediate(() => {
94 if (stderr) {
95 child.stderr.emit('data', Buffer.from(stderr));
96 }
97 child.emit('close', 1);
98 });
99 return child;
100}
101
102/**
103 * Fake long-running child process (e.g. `docker run`) that stays alive until

Callers 1

unit.test.tsFile · 0.85

Calls 1

emitMethod · 0.80

Tested by

no test coverage detected