Skip to content

Commit 3f99784

Browse files
author
chenbo
committed
Add sidecar evidence template snapshot test
1 parent 31fe014 commit 3f99784

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

test/opencode-launcher.test.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,17 @@ test("OpenCode sidecar runtime extracts commands, paths, output, and hashes", ()
115115
assert.match(hashText("ok"), /^[a-f0-9]{64}$/);
116116
});
117117

118-
test("OpenCode sidecar runtime records after-tool evidence through input JSON", () => {
119-
const runtimeSource = readFileSync(path.join(import.meta.dirname, "..", "src", "integrations", "opencode", "plugin-runtime", "index.ts"), "utf8");
118+
test("generated sidecar uses input-json evidence file", () => {
119+
const code = [
120+
opencodeSidecarPluginTemplate("./runtime.js"),
121+
readFileSync(path.join(import.meta.dirname, "..", "src", "integrations", "opencode", "plugin-runtime", "index.ts"), "utf8")
122+
].join("\n");
120123

121-
assert.match(runtimeSource, /"--input-json", inputJson/);
122-
assert.doesNotMatch(runtimeSource, /"--stdout"/);
123-
assert.doesNotMatch(runtimeSource, /"--stderr"/);
124-
assert.doesNotMatch(runtimeSource, /exitCodeFromOutput\(output\)\s*\?\?\s*0/);
125-
assert.doesNotMatch(runtimeSource, /String\(exitCodeFromOutput\(output\)\s*\?\?\s*0\)/);
124+
assert.match(code, /--input-json/);
125+
assert.doesNotMatch(code, /--stdout/);
126+
assert.doesNotMatch(code, /--stderr/);
127+
assert.doesNotMatch(code, /\?\?\s*0/);
128+
assert.match(code, /OpenCodePlusPlusSidecar/);
126129
});
127130

128131
test("OpenCode sidecar plugin uses the OpenCode++ path", () => {

0 commit comments

Comments
 (0)