perf(test): eliminate resetModules via injectable seams

This commit is contained in:
Peter Steinberger
2026-02-13 16:20:31 +00:00
parent a844fb161c
commit b272158fe4
21 changed files with 223 additions and 188 deletions

View File

@@ -242,14 +242,6 @@ describe("onboard (non-interactive): gateway and remote auth", () => {
const port = await getFreeGatewayPort();
const workspace = path.join(stateDir, "openclaw");
// Other test files mock ../config/config.js. This onboarding flow needs the real
// implementation so it can persist the config and then read it back (Windows CI
// otherwise sees a mocked writeConfigFile and the config never lands on disk).
vi.resetModules();
vi.doMock("../config/config.js", async () => {
return await vi.importActual("../config/config.js");
});
const { runNonInteractiveOnboarding } = await import("./onboard-non-interactive.js");
await runNonInteractiveOnboarding(
{