diff --git a/src/cli/plugins-cli.policy.test.ts b/src/cli/plugins-cli.policy.test.ts index ed48463b77d..5701656dcca 100644 --- a/src/cli/plugins-cli.policy.test.ts +++ b/src/cli/plugins-cli.policy.test.ts @@ -43,7 +43,6 @@ describe("plugins cli policy mutations", () => { function requireFirstWrittenConfig(): OpenClawConfig { const [config] = writeConfigFile.mock.calls[0] ?? []; - expect(config).toBeDefined(); if (!config) { throw new Error("expected writeConfigFile to receive a config"); } @@ -53,7 +52,6 @@ describe("plugins cli policy mutations", () => { function requirePluginEntries( config: OpenClawConfig, ): NonNullable["entries"]> { - expect(config.plugins?.entries).toBeDefined(); if (!config.plugins?.entries) { throw new Error("expected plugin entries in config"); } diff --git a/src/commands/agent-via-gateway.test.ts b/src/commands/agent-via-gateway.test.ts index 26ff3800bb4..3d37203cf89 100644 --- a/src/commands/agent-via-gateway.test.ts +++ b/src/commands/agent-via-gateway.test.ts @@ -303,12 +303,12 @@ describe("agentCliCommand", () => { expect(callGateway).toHaveBeenCalledTimes(1); expect(agentCommand).toHaveBeenCalledTimes(1); - const fallbackOpts = requireFirstCallArg<{ + const fallbackOpts = requireFirstCallArg(agentCommand, "embedded agent") as { sessionId?: string; sessionKey?: string; runId?: string; resultMetaOverrides?: unknown; - }>(agentCommand, "embedded agent"); + }; expect(fallbackOpts.sessionId).toMatch(/^gateway-fallback-/); expect(fallbackOpts.sessionId).not.toBe("locked-session"); expect(fallbackOpts.sessionKey).toBe(`agent:main:explicit:${fallbackOpts.sessionId}`); @@ -342,11 +342,11 @@ describe("agentCliCommand", () => { runtime, ); - const fallbackOpts = requireFirstCallArg<{ + const fallbackOpts = requireFirstCallArg(agentCommand, "embedded agent") as { sessionId?: string; sessionKey?: string; to?: string; - }>(agentCommand, "embedded agent"); + }; expect(fallbackOpts.to).toBe("+1555"); expect(fallbackOpts.sessionId).toMatch(/^gateway-fallback-/); expect(fallbackOpts.sessionKey).toBe(`agent:main:explicit:${fallbackOpts.sessionId}`); diff --git a/src/commands/status.test.ts b/src/commands/status.test.ts index 12bcce0e532..40aa4a7d9b2 100644 --- a/src/commands/status.test.ts +++ b/src/commands/status.test.ts @@ -87,7 +87,6 @@ function getRuntimeLogs() { function getRuntimeLog(index: number): string { const call = runtimeLogMock.mock.calls[index]; - expect(call).toBeDefined(); if (!call) { throw new Error(`expected runtime log call ${index}`); }