test(ci): preserve runtime module shape in qr tests

This commit is contained in:
Peter Steinberger
2026-04-03 22:05:25 +01:00
parent 66dfe18c36
commit 361efd28c9
2 changed files with 14 additions and 4 deletions

View File

@@ -49,7 +49,13 @@ const mocks = vi.hoisted(() => ({
}));
const runtime = runtimeState.defaultRuntime;
vi.mock("../runtime.js", () => ({ defaultRuntime: runtimeState.defaultRuntime }));
vi.mock("../runtime.js", async () => {
const actual = await vi.importActual<typeof import("../runtime.js")>("../runtime.js");
return {
...actual,
defaultRuntime: runtimeState.defaultRuntime,
};
});
vi.mock("../config/config.js", () => ({ loadConfig: mocks.loadConfig }));
vi.mock("../process/exec.js", () => ({ runCommandWithTimeout: mocks.runCommandWithTimeout }));
vi.mock("./command-secret-gateway.js", () => ({

View File

@@ -41,9 +41,13 @@ vi.mock("../infra/clipboard.js", () => ({
copyToClipboard: copyToClipboardMock,
}));
vi.mock("../runtime.js", () => ({
defaultRuntime: runtime,
}));
vi.mock("../runtime.js", async () => {
const actual = await vi.importActual<typeof import("../runtime.js")>("../runtime.js");
return {
...actual,
defaultRuntime: runtime,
};
});
let dashboardCommand: typeof import("../commands/dashboard.js").dashboardCommand;
let registerQrCli: typeof import("./qr-cli.js").registerQrCli;