test: guard plugin loader diagnostics · openclaw/openclaw@0e82b77
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -526,7 +526,9 @@ function expectRegistryErrorDiagnostic(params: {
|
526 | 526 | entry.pluginId === params.pluginId && |
527 | 527 | entry.message === params.message, |
528 | 528 | ); |
529 | | -expect(diagnostic, params.message).toBeDefined(); |
| 529 | +if (!diagnostic) { |
| 530 | +throw new Error(`Expected registry error diagnostic: ${params.message}`); |
| 531 | +} |
530 | 532 | } |
531 | 533 | |
532 | 534 | function expectDiagnosticContaining(params: { |
@@ -541,7 +543,9 @@ function expectDiagnosticContaining(params: {
|
541 | 543 | (!params.pluginId || entry.pluginId === params.pluginId) && |
542 | 544 | entry.message.includes(params.message), |
543 | 545 | ); |
544 | | -expect(diagnostic, params.message).toBeDefined(); |
| 546 | +if (!diagnostic) { |
| 547 | +throw new Error(`Expected diagnostic containing: ${params.message}`); |
| 548 | +} |
545 | 549 | } |
546 | 550 | |
547 | 551 | function expectNoDiagnosticContaining(params: { |
@@ -2160,7 +2164,9 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
2160 | 2164 | entry.pluginId === "bad-harness" && |
2161 | 2165 | entry.message === 'agent harness "broken" registration missing required runtime methods', |
2162 | 2166 | ); |
2163 | | -expect(diagnostic).toBeDefined(); |
| 2167 | +if (!diagnostic) { |
| 2168 | +throw new Error("Expected bad-harness runtime methods diagnostic"); |
| 2169 | +} |
2164 | 2170 | }); |
2165 | 2171 | |
2166 | 2172 | it("does not register internal hooks globally during non-activating loads", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。