mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 04:04:32 +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(
|
function mockGatewayWithHistory(
|
||||||
extra?: (req: { method?: string; params?: Record<string, unknown> }) => unknown,
|
extra?: (req: { method?: string; params?: Record<string, unknown> }) => unknown,
|
||||||
) {
|
) {
|
||||||
callGatewayMock.mockReset();
|
callGatewayMock.mockClear();
|
||||||
callGatewayMock.mockImplementation(async (opts: unknown) => {
|
callGatewayMock.mockImplementation(async (opts: unknown) => {
|
||||||
const req = opts as { method?: string; params?: Record<string, unknown> };
|
const req = opts as { method?: string; params?: Record<string, unknown> };
|
||||||
const handled = extra?.(req);
|
const handled = extra?.(req);
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ describe("sessions_spawn subagent lifecycle hooks", () => {
|
|||||||
hookRunnerMocks.runSubagentSpawned.mockClear();
|
hookRunnerMocks.runSubagentSpawned.mockClear();
|
||||||
hookRunnerMocks.runSubagentEnded.mockClear();
|
hookRunnerMocks.runSubagentEnded.mockClear();
|
||||||
const callGatewayMock = getCallGatewayMock();
|
const callGatewayMock = getCallGatewayMock();
|
||||||
callGatewayMock.mockReset();
|
callGatewayMock.mockClear();
|
||||||
setSessionsSpawnConfigOverride({
|
setSessionsSpawnConfigOverride({
|
||||||
session: {
|
session: {
|
||||||
mainKey: "main",
|
mainKey: "main",
|
||||||
|
|||||||
Reference in New Issue
Block a user