test(core): use lightweight clears in subagent and browser setup

This commit is contained in:
Peter Steinberger
2026-02-22 08:07:41 +00:00
parent dd5774a300
commit 2557945a8d
3 changed files with 6 additions and 6 deletions

View File

@@ -60,8 +60,8 @@ const baseCfg = {
describe("/subagents spawn command", () => {
beforeEach(() => {
resetSubagentRegistryForTests();
spawnSubagentDirectMock.mockReset();
hoisted.callGatewayMock.mockReset();
spawnSubagentDirectMock.mockClear();
hoisted.callGatewayMock.mockClear();
});
it("shows usage when agentId is missing", async () => {

View File

@@ -8,8 +8,8 @@ const getChromeWebSocketUrlSpy = vi.spyOn(chromeModule, "getChromeWebSocketUrl")
describe("pw-session getPageForTargetId", () => {
it("falls back to the only page when CDP session attachment is blocked (extension relays)", async () => {
connectOverCdpSpy.mockReset();
getChromeWebSocketUrlSpy.mockReset();
connectOverCdpSpy.mockClear();
getChromeWebSocketUrlSpy.mockClear();
const pageOn = vi.fn();
const contextOn = vi.fn();

View File

@@ -6,8 +6,8 @@ async function createMessageHandlerAndReplySpy() {
const replyModule = await import("../auto-reply/reply.js");
const replySpy = (replyModule as unknown as { __replySpy: ReturnType<typeof vi.fn> }).__replySpy;
onSpy.mockReset();
replySpy.mockReset();
onSpy.mockClear();
replySpy.mockClear();
createTelegramBot({ token: "tok" });
const handler = onSpy.mock.calls.find((call) => call[0] === "message")?.[1] as (