From 2111d0c653910087cf71cf91ae9f63813bf62129 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 07:23:20 +0000 Subject: [PATCH] test: force real config module for lan onboarding test (#766) --- .../onboard-non-interactive.lan-auto-token.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commands/onboard-non-interactive.lan-auto-token.test.ts b/src/commands/onboard-non-interactive.lan-auto-token.test.ts index db34440ba..8974efa78 100644 --- a/src/commands/onboard-non-interactive.lan-auto-token.test.ts +++ b/src/commands/onboard-non-interactive.lan-auto-token.test.ts @@ -145,9 +145,14 @@ describe("onboard (non-interactive): lan bind auto-token", () => { }; // 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. - vi.unmock("../config/config.js"); + // 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", + )) as typeof import("../config/config.js"); + }); const { runNonInteractiveOnboarding } = await import( "./onboard-non-interactive.js"