MCPcopy Index your code
hub / github.com/anus-dev/ANUS / simulateExecution

Function simulateExecution

packages/core/src/services/shellExecutionService.test.ts:81–97  ·  view source on GitHub ↗
(
    command: string,
    simulation: (cp: typeof mockChildProcess, ac: AbortController) => void,
  )

Source from the content-addressed store, hash-verified

79
80 // Helper function to run a standard execution simulation
81 const simulateExecution = async (
82 command: string,
83 simulation: (cp: typeof mockChildProcess, ac: AbortController) => void,
84 ) => {
85 const abortController = new AbortController();
86 const handle = ShellExecutionService.execute(
87 command,
88 '/test/dir',
89 onOutputEventMock,
90 abortController.signal,
91 );
92
93 await new Promise((resolve) => setImmediate(resolve));
94 simulation(mockChildProcess, abortController);
95 const result = await handle.result;
96 return { result, handle, abortController };
97 };
98
99 describe('Successful Execution', () => {
100 it('should execute a command and capture stdout and stderr', async () => {

Callers 1

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected