Skip to content

Commit 77f08fd

Browse files
b1rdmaniaclaude
andcommitted
fix: resolve all pre-existing test failures
- container-runner.ts: replace dynamic require('child_process') with static import so vi.mock() intercepts execSync in tests - container-runner.test.ts: add execSync mock to child_process stub - telegram.test.ts: add setMyCommands to mock bot api (already in previous commit) All 32 test files, 448 tests now pass locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d1ae7a2 commit 77f08fd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/container-runner.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ vi.mock('child_process', async () => {
7171
return {
7272
...actual,
7373
spawn: vi.fn(() => fakeProc),
74+
execSync: vi.fn(() => ''),
7475
exec: vi.fn(
7576
(_cmd: string, _opts: unknown, cb?: (err: Error | null) => void) => {
7677
if (cb) cb(null);

src/container-runner.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Agent Runner for GhostClaw
33
* Spawns agent execution as direct Node.js processes (no containers)
44
*/
5-
import { ChildProcess, spawn } from 'child_process';
5+
import { ChildProcess, spawn, execSync } from 'child_process';
66
import fs from 'fs';
77
import path from 'path';
88

@@ -194,7 +194,6 @@ function getAgentRunnerEntrypoint(): string {
194194

195195
if (!fs.existsSync(distEntry)) {
196196
logger.info('Agent runner not compiled, compiling now...');
197-
const { execSync } = require('child_process');
198197
execSync('npx tsc', { cwd: agentRunnerRoot, stdio: 'pipe' });
199198
}
200199

0 commit comments

Comments
 (0)