From 77b8765c0119c0ee01d93d4a0238fe8482687347 Mon Sep 17 00:00:00 2001 From: jverdicc Date: Sun, 1 Mar 2026 21:17:43 -0500 Subject: [PATCH] fix: syntax errors in openclaw-plugin test files --- .../tests/plugin.e2e-daemon.test.js | 3 +++ integrations/openclaw-plugin/tests/plugin.test.js | 15 ++------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/integrations/openclaw-plugin/tests/plugin.e2e-daemon.test.js b/integrations/openclaw-plugin/tests/plugin.e2e-daemon.test.js index 2faf31d..9a3490f 100644 --- a/integrations/openclaw-plugin/tests/plugin.e2e-daemon.test.js +++ b/integrations/openclaw-plugin/tests/plugin.e2e-daemon.test.js @@ -102,4 +102,7 @@ test("e2e preflight+postflight contract against daemon via plugin path", { skip: assert.ok(requestId.length > 0, "X-Request-Id must be non-empty"); } assert.ok(observedRewrite, "expected at least one DOWNGRADE rewrite from daemon preflight"); + } catch (err) { + throw err; + } }); diff --git a/integrations/openclaw-plugin/tests/plugin.test.js b/integrations/openclaw-plugin/tests/plugin.test.js index fd60206..cde3869 100644 --- a/integrations/openclaw-plugin/tests/plugin.test.js +++ b/integrations/openclaw-plugin/tests/plugin.test.js @@ -156,19 +156,6 @@ test("after_tool_call enforces REDACT rewrite", async () => { assert.equal(calls.length, 2); assert.equal(calls[1].preflightReceiptHash, "pre-1"); assert.equal(calls[1].outputHash.length, 64); - const plugin = createEvidenceGuardPlugin({ - evidenceUrl: "http://127.0.0.1:8787", - }); - - const first = await plugin.hooks.before_tool_call({ toolName: "safe.tool", params: { x: 1 } }); - assert.ok(!("block" in first)); - assert.ok(!("params" in first)); - assert.equal(first.receipt?.decision, "ALLOW"); - - const second = await plugin.hooks.before_tool_call({ toolName: "safe.tool", params: { x: 1 } }); - assert.ok(!("block" in second)); - assert.deepEqual(second.params, { safe: true }); - assert.equal(second.receipt?.decision, "ALLOW"); } finally { globalThis.fetch = originalFetch; } @@ -187,6 +174,8 @@ test("before_tool_call blocks tool writes without wasm+content when ASPEC gate e assert.equal(response.block, true); assert.match(response.blockReason ?? "", /AspecRequired/); +}); + test("before_tool_call fails closed when preflight response omits decision", async () => { const originalFetch = globalThis.fetch; globalThis.fetch = async () =>