test: type onboarding plugin enable mock · openclaw/openclaw@e62431f
steipete
·
2026-04-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs/promises"; |
2 | 2 | import path from "node:path"; |
3 | 3 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
| 4 | +import type { OpenClawConfig } from "../config/types.openclaw.js"; |
| 5 | +import type { PluginEnableResult } from "../plugins/enable.js"; |
4 | 6 | import { withTempDir } from "../test-helpers/temp-dir.js"; |
5 | 7 | |
6 | 8 | const resolveBundledInstallPlanForCatalogEntry = vi.hoisted(() => vi.fn(() => undefined)); |
@@ -20,7 +22,9 @@ vi.mock("../plugins/install.js", () => ({
|
20 | 22 | installPluginFromNpmSpec, |
21 | 23 | })); |
22 | 24 | |
23 | | -const enablePluginInConfig = vi.hoisted(() => vi.fn((cfg) => ({ config: cfg, enabled: true }))); |
| 25 | +const enablePluginInConfig = vi.hoisted(() => |
| 26 | +vi.fn((cfg: OpenClawConfig): PluginEnableResult => ({ config: cfg, enabled: true })), |
| 27 | +); |
24 | 28 | vi.mock("../plugins/enable.js", () => ({ |
25 | 29 | enablePluginInConfig, |
26 | 30 | })); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。