mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
23 lines
542 B
TypeScript
23 lines
542 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { runCommandWithTimeout } from "./exec.js";
|
|
|
|
describe("runCommandWithTimeout", () => {
|
|
it("passes env overrides to child", async () => {
|
|
const result = await runCommandWithTimeout(
|
|
[
|
|
process.execPath,
|
|
"-e",
|
|
'process.stdout.write(process.env.CLAWDBOT_TEST_ENV ?? "")',
|
|
],
|
|
{
|
|
timeoutMs: 5_000,
|
|
env: { CLAWDBOT_TEST_ENV: "ok" },
|
|
},
|
|
);
|
|
|
|
expect(result.code).toBe(0);
|
|
expect(result.stdout).toBe("ok");
|
|
});
|
|
});
|