mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:51:23 +00:00
test: fix flaky run-node spawn side-effects
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import fsSync from "node:fs";
|
||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
@@ -26,9 +27,9 @@ describe("run-node script", () => {
|
|||||||
const nodeCalls: string[][] = [];
|
const nodeCalls: string[][] = [];
|
||||||
const spawn = (cmd: string, args: string[]) => {
|
const spawn = (cmd: string, args: string[]) => {
|
||||||
if (cmd === "pnpm") {
|
if (cmd === "pnpm") {
|
||||||
void fs.writeFile(argsPath, args.join(" "), "utf-8");
|
fsSync.writeFileSync(argsPath, args.join(" "), "utf-8");
|
||||||
if (!args.includes("--no-clean")) {
|
if (!args.includes("--no-clean")) {
|
||||||
void fs.rm(path.join(tmp, "dist", "control-ui"), { recursive: true, force: true });
|
fsSync.rmSync(path.join(tmp, "dist", "control-ui"), { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd === process.execPath) {
|
if (cmd === process.execPath) {
|
||||||
|
|||||||
Reference in New Issue
Block a user