test: unmock config for lan onboarding auto-token (#766)

This commit is contained in:
Peter Steinberger
2026-01-12 07:17:21 +00:00
parent 88716d8d2a
commit 642e6acf49

View File

@@ -3,7 +3,7 @@ import { createServer } from "node:net";
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
import { WebSocket } from "ws";
import { PROTOCOL_VERSION } from "../gateway/protocol/index.js";
@@ -144,6 +144,11 @@ 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");
vi.resetModules();
const { runNonInteractiveOnboarding } = await import(
"./onboard-non-interactive.js"
);