test(plugins): assert legacy channel schema exports · openclaw/openclaw@2d2402c
vincentkoc
·
2026-04-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -164,14 +164,17 @@ describe("config footprint guardrails", () => {
|
164 | 164 | |
165 | 165 | it("keeps bundled channel schemas as a fixed legacy SDK compatibility surface", () => { |
166 | 166 | const source = readSource("src/plugin-sdk/channel-config-schema.ts"); |
167 | | -const providersCoreExports = source.match( |
168 | | -/Legacy bundled channel schema exports[\s\S]*?export \{(?<exports>[\s\S]*?)\} from "\.\.\/config\/zod-schema\.providers-core\.js";/, |
169 | | -)?.groups?.exports; |
170 | | -expect(providersCoreExports).toBeDefined(); |
171 | | -const exportedSchemaNames = Array.from( |
172 | | -`${providersCoreExports ?? ""}\nWhatsAppConfigSchema`.matchAll( |
173 | | -/\b([A-Z][A-Za-z0-9]+ConfigSchema)\b/g, |
| 167 | +const legacySection = source.slice(source.indexOf("Legacy bundled channel schema exports")); |
| 168 | +const bundledSchemaExportBlocks = Array.from( |
| 169 | +legacySection.matchAll( |
| 170 | +/export \{(?<exports>[\s\S]*?)\} from "\.\.\/config\/zod-schema\.providers-(?:core|whatsapp)\.js";/g, |
174 | 171 | ), |
| 172 | +) |
| 173 | +.map((match) => match.groups?.exports) |
| 174 | +.filter((block): block is string => Boolean(block)); |
| 175 | +expect(bundledSchemaExportBlocks).toHaveLength(2); |
| 176 | +const exportedSchemaNames = Array.from( |
| 177 | +bundledSchemaExportBlocks.join("\n").matchAll(/\b([A-Z][A-Za-z0-9]+ConfigSchema)\b/g), |
175 | 178 | ) |
176 | 179 | .map((match) => match[1]) |
177 | 180 | .filter((name): name is string => Boolean(name)) |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。