From 5de3196a60dcb4c0745d8cd41b51b0e253798cc8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 00:33:40 +0100 Subject: [PATCH] test: satisfy plugin contract boundaries --- src/plugins/bundled-runtime-root.test.ts | 6 +++++- test/helpers/plugins/tts-contract-suites.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/bundled-runtime-root.test.ts b/src/plugins/bundled-runtime-root.test.ts index a00e5096c35..af9e11d2d64 100644 --- a/src/plugins/bundled-runtime-root.test.ts +++ b/src/plugins/bundled-runtime-root.test.ts @@ -220,7 +220,11 @@ describe("prepareBundledPluginRuntimeRoot", () => { ); fs.writeFileSync( path.join(runtimePluginRoot, "index.js"), - `export { default } from "../../../dist/extensions/qqbot/index.js";\n`, + [ + "export { default } from ", + JSON.stringify("../../../dist/extensions/qqbot/index.js"), + ";\n", + ].join(""), "utf8", ); fs.writeFileSync( diff --git a/test/helpers/plugins/tts-contract-suites.ts b/test/helpers/plugins/tts-contract-suites.ts index 7a6a3701eb6..ec77ba4ec24 100644 --- a/test/helpers/plugins/tts-contract-suites.ts +++ b/test/helpers/plugins/tts-contract-suites.ts @@ -3,12 +3,12 @@ import type { ResolvedTtsConfig, SpeechProviderPlugin } from "openclaw/plugin-sd import type { OpenClawConfig } from "openclaw/plugin-sdk/testing"; import { createEmptyPluginRegistry, + pluginRegistrationContractRegistry, setActivePluginRegistry, withEnv, withEnvAsync, } from "openclaw/plugin-sdk/testing"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS } from "../../../src/plugins/contracts/inventory/bundled-capability-metadata.js"; import { resolveWorkspacePackagePublicModuleUrl } from "./public-surface-loader.js"; type TtsRuntimeModule = typeof import("openclaw/plugin-sdk/tts-runtime"); @@ -42,7 +42,7 @@ let sanitizeTtsErrorForLog: TtsRuntimeModule["_test"]["sanitizeTtsErrorForLog"]; const SPEECH_PROVIDER_ENV_KEYS = [ ...new Set( - BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS.flatMap((entry) => + pluginRegistrationContractRegistry.flatMap((entry) => entry.speechProviderIds.flatMap((providerId) => entry.providerAuthEnvVars[providerId] ?? []), ), ),