mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-27 00:17:29 +00:00
fix: move Mistral compat into provider plugin
This commit is contained in:
48
scripts/test-live.mjs
Normal file
48
scripts/test-live.mjs
Normal file
@@ -0,0 +1,48 @@
|
||||
import { spawn } from "node:child_process";
|
||||
|
||||
const forwardedArgs = [];
|
||||
let quietOverride;
|
||||
|
||||
for (const arg of process.argv.slice(2)) {
|
||||
if (arg === "--") {
|
||||
continue;
|
||||
}
|
||||
if (arg === "--quiet" || arg === "--quiet-live") {
|
||||
quietOverride = "1";
|
||||
continue;
|
||||
}
|
||||
if (arg === "--no-quiet" || arg === "--no-quiet-live") {
|
||||
quietOverride = "0";
|
||||
continue;
|
||||
}
|
||||
forwardedArgs.push(arg);
|
||||
}
|
||||
|
||||
const env = {
|
||||
...process.env,
|
||||
OPENCLAW_LIVE_TEST: process.env.OPENCLAW_LIVE_TEST || "1",
|
||||
OPENCLAW_LIVE_TEST_QUIET: quietOverride ?? process.env.OPENCLAW_LIVE_TEST_QUIET ?? "1",
|
||||
};
|
||||
|
||||
const command = process.platform === "win32" ? "pnpm.cmd" : "pnpm";
|
||||
const child = spawn(
|
||||
command,
|
||||
["exec", "vitest", "run", "--config", "vitest.live.config.ts", ...forwardedArgs],
|
||||
{
|
||||
stdio: "inherit",
|
||||
env,
|
||||
},
|
||||
);
|
||||
|
||||
child.on("exit", (code, signal) => {
|
||||
if (signal) {
|
||||
process.kill(process.pid, signal);
|
||||
return;
|
||||
}
|
||||
process.exit(code ?? 1);
|
||||
});
|
||||
|
||||
child.on("error", (error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user