(args?: string[]): MockRuntime Create a mock RuntimeDeps for testing.
The mock exit records the code on exit_calls and throws MockExitError
(so the never-returning contract holds in tests). fetch throws TypeError
when no mock_fetch_responses pattern matches the request URL.
args
string[][]returns
MockRuntime MockRuntime with controllable state
examples
const runtime = create_mock_runtime(['apply', 'zap.ts']);
runtime.mock_env.set('HOME', '/home/test');
runtime.mock_fs.set('/home/test/.app/config.json', '{}');
await some_function(runtime);
assert.strictEqual(runtime.command_calls.length, 1);
assert.deepStrictEqual(runtime.exit_calls, [0]);