MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / runHarness

Function runHarness

test/main/idle-timeout-spawn.test.mjs:43–60  ·  view source on GitHub ↗
(withFix)

Source from the content-addressed store, hash-verified

41}
42
43function runHarness(withFix) {
44 return new Promise((resolve) => {
45 const tmpDir = mkdtempSync(join(tmpdir(), "cp-test-"));
46 const scriptPath = join(tmpDir, "harness.mjs");
47 writeFileSync(scriptPath, createTestScript(withFix));
48
49 const child = spawn("node", [scriptPath], {
50 stdio: ["pipe", "pipe", "pipe"],
51 });
52
53 let stderr = "";
54 child.stderr.on("data", (d) => { stderr += d.toString(); });
55
56 child.on("exit", (code) => {
57 resolve({ code, stderr });
58 });
59 });
60}
61
62describe("idle-timeout transport-aware fix", () => {
63 it("does NOT fire onIdle when isTransportAlive returns true", async () => {

Callers 1

Calls 1

createTestScriptFunction · 0.85

Tested by

no test coverage detected