mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 00:21:59 +00:00
refactor(test): dedupe setup wizard helpers
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
|
||||
import { createNonExitingRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
|
||||
|
||||
const resolveMatrixTargetsMock = vi.hoisted(() => vi.fn(async () => []));
|
||||
|
||||
@@ -20,7 +20,7 @@ describe("matrix resolver adapter", () => {
|
||||
accountId: "ops",
|
||||
inputs: ["Alice"],
|
||||
kind: "user",
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }),
|
||||
runtime: createNonExitingRuntimeEnv(),
|
||||
});
|
||||
|
||||
expect(resolveMatrixTargetsMock).toHaveBeenCalledWith({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
|
||||
import { createNonExitingTypedRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
|
||||
import type { RuntimeEnv, WizardPrompter } from "../runtime-api.js";
|
||||
import { matrixOnboardingAdapter } from "./onboarding.js";
|
||||
import { installMatrixTestRuntime } from "./test-runtime.js";
|
||||
@@ -83,7 +83,7 @@ describe("matrix onboarding account-scoped resolution", () => {
|
||||
},
|
||||
},
|
||||
} as CoreConfig,
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }) as unknown as RuntimeEnv,
|
||||
runtime: createNonExitingTypedRuntimeEnv<RuntimeEnv>(),
|
||||
prompter,
|
||||
options: undefined,
|
||||
accountOverrides: {},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
|
||||
import { createNonExitingTypedRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
|
||||
import type { RuntimeEnv, WizardPrompter } from "../runtime-api.js";
|
||||
import { matrixOnboardingAdapter } from "./onboarding.js";
|
||||
import { installMatrixTestRuntime } from "./test-runtime.js";
|
||||
@@ -82,7 +82,7 @@ describe("matrix onboarding", () => {
|
||||
},
|
||||
},
|
||||
} as CoreConfig,
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }) as unknown as RuntimeEnv,
|
||||
runtime: createNonExitingTypedRuntimeEnv<RuntimeEnv>(),
|
||||
prompter,
|
||||
options: undefined,
|
||||
accountOverrides: {},
|
||||
@@ -152,7 +152,7 @@ describe("matrix onboarding", () => {
|
||||
},
|
||||
},
|
||||
} as CoreConfig,
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }) as unknown as RuntimeEnv,
|
||||
runtime: createNonExitingTypedRuntimeEnv<RuntimeEnv>(),
|
||||
prompter,
|
||||
options: undefined,
|
||||
accountOverrides: {},
|
||||
@@ -199,7 +199,7 @@ describe("matrix onboarding", () => {
|
||||
await expect(
|
||||
matrixOnboardingAdapter.configureInteractive!({
|
||||
cfg: { channels: {} } as CoreConfig,
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }) as unknown as RuntimeEnv,
|
||||
runtime: createNonExitingTypedRuntimeEnv<RuntimeEnv>(),
|
||||
prompter,
|
||||
options: undefined,
|
||||
accountOverrides: {},
|
||||
@@ -253,7 +253,7 @@ describe("matrix onboarding", () => {
|
||||
|
||||
const result = await matrixOnboardingAdapter.configureInteractive!({
|
||||
cfg: {} as CoreConfig,
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }) as unknown as RuntimeEnv,
|
||||
runtime: createNonExitingTypedRuntimeEnv<RuntimeEnv>(),
|
||||
prompter,
|
||||
options: undefined,
|
||||
accountOverrides: {},
|
||||
@@ -366,7 +366,7 @@ describe("matrix onboarding", () => {
|
||||
},
|
||||
},
|
||||
} as CoreConfig,
|
||||
runtime: createRuntimeEnv({ throwOnExit: false }) as unknown as RuntimeEnv,
|
||||
runtime: createNonExitingTypedRuntimeEnv<RuntimeEnv>(),
|
||||
prompter,
|
||||
options: undefined,
|
||||
accountOverrides: {},
|
||||
|
||||
Reference in New Issue
Block a user