Skip to content

Commit 17482a4

Browse files
authored
fix(ci): restore docs and test type checks (#98792)
1 parent cdaafe1 commit 17482a4

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

docs/docs_map.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,11 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
12451245
- H2: Notes
12461246
- H2: Related
12471247

1248+
## cli/attach.md
1249+
1250+
- Route: /cli/attach
1251+
- Headings: none
1252+
12481253
## cli/backup.md
12491254

12501255
- Route: /cli/backup

src/cli/attach-cli.action.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,20 @@ const gatewayCalls: Array<{
1111
mode?: string;
1212
hasDeviceIdentityKey: boolean;
1313
}> = [];
14+
15+
function gatewayParams(params: unknown): Record<string, unknown> {
16+
if (typeof params !== "object" || params === null || Array.isArray(params)) {
17+
throw new TypeError("Expected gateway params to be an object");
18+
}
19+
return params as Record<string, unknown>;
20+
}
21+
1422
vi.mock("../gateway/call.js", () => ({
1523
callGateway: vi.fn(
1624
async (p: { method: string; params: Record<string, unknown>; mode?: string }) => {
1725
gatewayCalls.push({
1826
method: p.method,
19-
params: p.params,
27+
params: gatewayParams(p.params),
2028
mode: p.mode,
2129
hasDeviceIdentityKey: "deviceIdentity" in p,
2230
});
@@ -156,7 +164,7 @@ describe("openclaw attach (action)", () => {
156164
vi.mocked(callGateway).mockImplementationOnce(async (p) => {
157165
gatewayCalls.push({
158166
method: p.method,
159-
params: p.params,
167+
params: gatewayParams(p.params),
160168
mode: p.mode,
161169
hasDeviceIdentityKey: "deviceIdentity" in p,
162170
});
@@ -171,7 +179,7 @@ describe("openclaw attach (action)", () => {
171179
vi.mocked(callGateway).mockImplementationOnce(async (p) => {
172180
gatewayCalls.push({
173181
method: p.method,
174-
params: p.params,
182+
params: gatewayParams(p.params),
175183
mode: p.mode,
176184
hasDeviceIdentityKey: "deviceIdentity" in p,
177185
});

0 commit comments

Comments
 (0)