test: speed up core runtime suites

This commit is contained in:
Peter Steinberger
2026-03-31 02:12:14 +01:00
parent f7285e0a9e
commit 6b6ddcd2a6
93 changed files with 874 additions and 980 deletions

View File

@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const resolveRuntimePluginRegistryMock = vi.fn();
const applyPluginAutoEnableMock = vi.fn();
@@ -97,8 +97,15 @@ async function expectCloseMemoryRuntimeCase(params: {
}
describe("memory runtime auto-enable loading", () => {
beforeEach(async () => {
vi.resetModules();
beforeAll(async () => {
({
getActiveMemorySearchManager,
resolveActiveMemoryBackendConfig,
closeActiveMemorySearchManagers,
} = await import("./memory-runtime.js"));
});
beforeEach(() => {
resolveRuntimePluginRegistryMock.mockReset();
applyPluginAutoEnableMock.mockReset();
getMemoryRuntimeMock.mockReset();
@@ -106,11 +113,6 @@ describe("memory runtime auto-enable loading", () => {
config: params.config,
changes: [],
}));
({
getActiveMemorySearchManager,
resolveActiveMemoryBackendConfig,
closeActiveMemorySearchManagers,
} = await import("./memory-runtime.js"));
});
it.each([