MCPcopy Create free account
hub / github.com/continuedev/continue / createMockProcess

Function createMockProcess

core/util/processTerminalStates.test.ts:20–37  ·  view source on GitHub ↗
(
  pid: number = 123,
  killed: boolean = false,
)

Source from the content-addressed store, hash-verified

18
19// Mock ChildProcess
20const createMockProcess = (
21 pid: number = 123,
22 killed: boolean = false,
23): jest.Mocked<ChildProcess> => {
24 const mockProcess = {
25 pid,
26 killed,
27 kill: jest.fn(),
28 } as unknown as jest.Mocked<ChildProcess>;
29
30 // Make kill() update the killed property
31 mockProcess.kill.mockImplementation(() => {
32 (mockProcess as any).killed = true;
33 return true;
34 });
35
36 return mockProcess;
37};
38
39describe("processTerminalStates", () => {
40 beforeEach(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected