Download src/node-host/invoke.test-support.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 938 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/node-host/invoke.test-support.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/node-host/invoke.test-support.ts
-
curl -L -o invoke.test-support.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/node-host/invoke.test-support.ts
938 Bytes
| import type { RunResult } from "./invoke-types.js"; | |
| import "./invoke.js"; | |
| type NodeHostInvokeTestApi = { | |
| clarifyNodeExecCwdSpawnError(error: NodeJS.ErrnoException, cwd: string | undefined): string; | |
| runCommand( | |
| argv: string[], | |
| cwd: string | undefined, | |
| env: Record<string, string> | undefined, | |
| timeoutMs: number | undefined, | |
| signal?: AbortSignal, | |
| assertCurrent?: () => void, | |
| ): Promise<RunResult>; | |
| }; | |
| function getTestApi(): NodeHostInvokeTestApi { | |
| return (globalThis as Record<PropertyKey, unknown>)[ | |
| Symbol.for("openclaw.nodeHostInvokeTestApi") | |
| ] as NodeHostInvokeTestApi; | |
| } | |
| export const testing: NodeHostInvokeTestApi = { | |
| clarifyNodeExecCwdSpawnError(error, cwd) { | |
| return getTestApi().clarifyNodeExecCwdSpawnError(error, cwd); | |
| }, | |
| runCommand(argv, cwd, env, timeoutMs, signal, assertCurrent) { | |
| return getTestApi().runCommand(argv, cwd, env, timeoutMs, signal, assertCurrent); | |
| }, | |
| }; | |