test(core): reduce mock reset overhead in targeted suites

This commit is contained in:
Peter Steinberger
2026-02-22 08:40:24 +00:00
parent 2a66c8d676
commit ccc00d874c
8 changed files with 19 additions and 12 deletions

View File

@@ -101,7 +101,7 @@ async function runCronTurn(home: string, options: RunCronTurnOptions = {}) {
const storePath = options.storePath ?? (await writeSessionStore(home, options.storeEntries));
const deps = options.deps ?? makeDeps();
if (options.mockTexts === null) {
vi.mocked(runEmbeddedPiAgent).mockReset();
vi.mocked(runEmbeddedPiAgent).mockClear();
} else {
mockEmbeddedTexts(options.mockTexts ?? ["ok"]);
}
@@ -158,7 +158,7 @@ async function runTurnWithStoredModelOverride(
describe("runCronIsolatedAgentTurn", () => {
beforeEach(() => {
vi.mocked(runEmbeddedPiAgent).mockReset();
vi.mocked(runEmbeddedPiAgent).mockClear();
vi.mocked(loadModelCatalog).mockResolvedValue([]);
});