mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
test(shell): handle nullable exit metadata
Make the shell exit assertions typecheck cleanly while keeping the PowerShell regression coverage. Remove the accidentally committed .opencode package-lock so generated state does not ship in the branch.
This commit is contained in:
-31
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": ".opencode",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@opencode-ai/plugin": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@opencode-ai/plugin": {
|
||||
"version": "1.2.24",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@opencode-ai/sdk": "1.2.24",
|
||||
"zod": "4.1.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@opencode-ai/sdk": {
|
||||
"version": "1.2.24",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "4.1.8",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ describe("tool.shell", () => {
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
expect(result.metadata.exit).toBe(0)
|
||||
expect(result.metadata.exit ?? -1).toBe(0)
|
||||
expect(result.metadata.output).toContain("test")
|
||||
},
|
||||
})
|
||||
@@ -1005,7 +1005,7 @@ describe("tool.shell runtime", () => {
|
||||
)
|
||||
expect(result.output).toContain("333")
|
||||
expect(result.output).toContain("444")
|
||||
expect(result.metadata.exit).toBe(0)
|
||||
expect(result.metadata.exit ?? -1).toBe(0)
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -1022,7 +1022,7 @@ describe("tool.shell runtime", () => {
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
expect(result.metadata.exit).toBe(42)
|
||||
expect(result.metadata.exit ?? -1).toBe(42)
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -1039,7 +1039,7 @@ describe("tool.shell runtime", () => {
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
expect(result.metadata.exit).toBe(42)
|
||||
expect(result.metadata.exit ?? -1).toBe(42)
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -1056,7 +1056,7 @@ describe("tool.shell runtime", () => {
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
expect(result.metadata.exit).toBe(1)
|
||||
expect(result.metadata.exit ?? -1).toBe(1)
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user