mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
test: remove plugin contract timer flushes
This commit is contained in:
@@ -45,9 +45,7 @@ import { runTrustedToolPolicies } from "../trusted-tool-policy.js";
|
||||
import { registerHostHookFixture, registerTrustedHostHookFixture } from "./host-hook-fixture.js";
|
||||
|
||||
async function waitForPluginEventHandlers(): Promise<void> {
|
||||
await new Promise<void>((resolve) => {
|
||||
setTimeout(resolve, 0);
|
||||
});
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
}
|
||||
|
||||
function requireFirstCommandRegistration(
|
||||
|
||||
@@ -26,9 +26,7 @@ import { createPluginRecord } from "../status.test-helpers.js";
|
||||
import type { OpenClawPluginApi } from "../types.js";
|
||||
|
||||
async function waitForPluginEventHandlers(): Promise<void> {
|
||||
await new Promise<void>((resolve) => {
|
||||
setTimeout(resolve, 0);
|
||||
});
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
}
|
||||
|
||||
function expectNoCleanupFailures(result: Awaited<ReturnType<typeof runPluginHostCleanup>>): void {
|
||||
|
||||
@@ -418,13 +418,9 @@ describe("tui command handlers", () => {
|
||||
throw new Error("expected /new to set a TUI session key");
|
||||
}
|
||||
expect(newSessionKey.startsWith("tui-")).toBe(true);
|
||||
const uuidParts = newSessionKey.slice("tui-".length).split("-");
|
||||
const uuidParts: string[] = newSessionKey.slice("tui-".length).split("-");
|
||||
expect(uuidParts.map((part) => part.length)).toEqual([8, 4, 4, 4, 12]);
|
||||
expect(
|
||||
uuidParts.every((part) =>
|
||||
[...part].every((char) => (char >= "0" && char <= "9") || (char >= "a" && char <= "f")),
|
||||
),
|
||||
).toBe(true);
|
||||
expect(uuidParts.every((part) => /^[0-9a-f]+$/.test(part))).toBe(true);
|
||||
// /reset still resets the shared session
|
||||
expect(resetSession).toHaveBeenCalledTimes(1);
|
||||
expect(resetSession).toHaveBeenCalledWith("agent:main:main", "reset");
|
||||
|
||||
Reference in New Issue
Block a user