Skip to content

Commit ad191ed

Browse files
lsr911claude
andcommitted
fix(test): cast ChildProcess mock through unknown for type-check compatibility
ClawSweeper review flagged the direct EventEmitter → ChildProcess cast at json-rpc-client.stream-errors.test.ts:37. Cast through unknown so check-test-types passes without weakening the test assertions. Co-Authored-By: Claude <[email protected]>
1 parent 46eac4f commit ad191ed

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

extensions/codex-supervisor/src/json-rpc-client.stream-errors.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ const { spawnMock } = vi.hoisted(() => ({
99
}));
1010

1111
vi.mock("node:child_process", async () => {
12-
const { mockNodeBuiltinModule } = await import(
13-
"openclaw/plugin-sdk/test-node-mocks"
14-
);
12+
const { mockNodeBuiltinModule } = await import("openclaw/plugin-sdk/test-node-mocks");
1513
return mockNodeBuiltinModule(
16-
() =>
17-
vi.importActual<typeof import("node:child_process")>("node:child_process"),
14+
() => vi.importActual<typeof import("node:child_process")>("node:child_process"),
1815
{ spawn: spawnMock },
1916
);
2017
});
@@ -39,7 +36,7 @@ describe("StdioCodexJsonRpcConnection stream error handling", () => {
3936
stdout,
4037
stderr,
4138
stdin,
42-
}) as ChildProcess;
39+
}) as unknown as ChildProcess;
4340

4441
spawnMock.mockReturnValue(child);
4542

0 commit comments

Comments
 (0)