test: group remaining suite cleanups

This commit is contained in:
Peter Steinberger
2026-02-21 21:43:24 +00:00
parent 5c8f0b5a77
commit 861718e4dc
32 changed files with 870 additions and 922 deletions

View File

@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest";
import { beforeAll, describe, expect, it, vi } from "vitest";
import {
addSubagentRunForTests,
listSubagentRunsForRequester,
@@ -41,7 +41,13 @@ const waitForCalls = async (getCount: () => number, count: number, timeoutMs = 2
);
};
let sessionsModule: typeof import("../config/sessions.js");
describe("sessions tools", () => {
beforeAll(async () => {
sessionsModule = await import("../config/sessions.js");
});
it("uses number (not integer) in tool schemas for Gemini compatibility", () => {
const tools = createOpenClawTools();
const byName = (name: string) => {
@@ -767,7 +773,6 @@ describe("sessions tools", () => {
startedAt: now - 2 * 60_000,
});
const sessionsModule = await import("../config/sessions.js");
const loadSessionStoreSpy = vi
.spyOn(sessionsModule, "loadSessionStore")
.mockImplementation(() => ({
@@ -827,7 +832,6 @@ describe("sessions tools", () => {
startedAt: Date.now() - 60_000,
});
const sessionsModule = await import("../config/sessions.js");
const loadSessionStoreSpy = vi
.spyOn(sessionsModule, "loadSessionStore")
.mockImplementation(() => ({