mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:14:31 +00:00
test(gateway): use lightweight clears for chat-b reply spy fences
This commit is contained in:
@@ -151,7 +151,7 @@ describe("gateway server chat", () => {
|
|||||||
await writeMainSessionStore();
|
await writeMainSessionStore();
|
||||||
testState.agentConfig = { blockStreamingDefault: "on" };
|
testState.agentConfig = { blockStreamingDefault: "on" };
|
||||||
try {
|
try {
|
||||||
spy.mockReset();
|
spy.mockClear();
|
||||||
let capturedOpts: GetReplyOptions | undefined;
|
let capturedOpts: GetReplyOptions | undefined;
|
||||||
spy.mockImplementationOnce(async (_ctx: unknown, opts?: GetReplyOptions) => {
|
spy.mockImplementationOnce(async (_ctx: unknown, opts?: GetReplyOptions) => {
|
||||||
capturedOpts = opts;
|
capturedOpts = opts;
|
||||||
@@ -343,7 +343,7 @@ describe("gateway server chat", () => {
|
|||||||
await createSessionDir();
|
await createSessionDir();
|
||||||
await writeMainSessionStore();
|
await writeMainSessionStore();
|
||||||
|
|
||||||
spy.mockReset();
|
spy.mockClear();
|
||||||
spy.mockImplementationOnce(async (_ctx, opts) => {
|
spy.mockImplementationOnce(async (_ctx, opts) => {
|
||||||
opts?.onAgentRunStart?.(opts.runId ?? "idem-abort-1");
|
opts?.onAgentRunStart?.(opts.runId ?? "idem-abort-1");
|
||||||
const signal = opts?.abortSignal;
|
const signal = opts?.abortSignal;
|
||||||
@@ -403,7 +403,7 @@ describe("gateway server chat", () => {
|
|||||||
{ timeout: 2_000, interval: 10 },
|
{ timeout: 2_000, interval: 10 },
|
||||||
);
|
);
|
||||||
|
|
||||||
spy.mockReset();
|
spy.mockClear();
|
||||||
spy.mockResolvedValueOnce(undefined);
|
spy.mockResolvedValueOnce(undefined);
|
||||||
|
|
||||||
const completeRes = await rpcReq<{ status?: string }>(ws, "chat.send", {
|
const completeRes = await rpcReq<{ status?: string }>(ws, "chat.send", {
|
||||||
|
|||||||
Reference in New Issue
Block a user