test: canonicalise plugin discovery paths · openclaw/openclaw@c80152e
shakkernerd
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -270,7 +270,10 @@ function expectCandidateSource(
|
270 | 270 | idHint: string, |
271 | 271 | source: string, |
272 | 272 | ) { |
273 | | -expect(findCandidateById(candidates, idHint)?.source).toBe(source); |
| 273 | +const actualSource = findCandidateById(candidates, idHint)?.source; |
| 274 | +const normalizeSource = (value: string | undefined) => |
| 275 | +value && fs.existsSync(value) ? fs.realpathSync(value) : value; |
| 276 | +expect(normalizeSource(actualSource)).toBe(normalizeSource(source)); |
274 | 277 | } |
275 | 278 | |
276 | 279 | function expectEscapesPackageDiagnostic(diagnostics: Array<{ message: string }>) { |
@@ -634,7 +637,9 @@ describe("discoverOpenClawPlugins", () => {
|
634 | 637 | discoverOpenClawPlugins({ env: buildDiscoveryEnv(stateDir) }), |
635 | 638 | ); |
636 | 639 | |
637 | | -expect(result.diagnostics.some((entry) => entry.message.includes("pnpm install"))).toBe(false); |
| 640 | +expect(result.diagnostics.map((entry) => entry.message).join("\n")).not.toContain( |
| 641 | +"pnpm install", |
| 642 | +); |
638 | 643 | }); |
639 | 644 | |
640 | 645 | it("does not treat repo-level live or test files as plugin entrypoints", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。