mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 04:11:22 +00:00
test(agents): reduce reset overhead in session visibility and hooks specs
This commit is contained in:
@@ -35,7 +35,7 @@ function getSessionsHistoryTool(options?: { sandboxed?: boolean }) {
|
||||
function mockGatewayWithHistory(
|
||||
extra?: (req: { method?: string; params?: Record<string, unknown> }) => unknown,
|
||||
) {
|
||||
callGatewayMock.mockReset();
|
||||
callGatewayMock.mockClear();
|
||||
callGatewayMock.mockImplementation(async (opts: unknown) => {
|
||||
const req = opts as { method?: string; params?: Record<string, unknown> };
|
||||
const handled = extra?.(req);
|
||||
|
||||
@@ -84,7 +84,7 @@ describe("sessions_spawn subagent lifecycle hooks", () => {
|
||||
hookRunnerMocks.runSubagentSpawned.mockClear();
|
||||
hookRunnerMocks.runSubagentEnded.mockClear();
|
||||
const callGatewayMock = getCallGatewayMock();
|
||||
callGatewayMock.mockReset();
|
||||
callGatewayMock.mockClear();
|
||||
setSessionsSpawnConfigOverride({
|
||||
session: {
|
||||
mainKey: "main",
|
||||
|
||||
Reference in New Issue
Block a user