test: clarify plugin discovery assertions · openclaw/openclaw@fd2914f
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1657,7 +1657,7 @@ describe("discoverOpenClawPlugins", () => {
|
1657 | 1657 | |
1658 | 1658 | const { candidates } = await discoverWithStateDir(stateDir, {}); |
1659 | 1659 | |
1660 | | -expect(candidates.some((candidate) => candidate.idHint === "pack")).toBe(false); |
| 1660 | +expect(candidates.map((candidate) => candidate.idHint)).not.toContain("pack"); |
1661 | 1661 | }); |
1662 | 1662 | |
1663 | 1663 | it.runIf(process.platform !== "win32")("blocks world-writable plugin paths", async () => { |
@@ -1693,7 +1693,7 @@ describe("discoverOpenClawPlugins", () => {
|
1693 | 1693 | }), |
1694 | 1694 | ); |
1695 | 1695 | |
1696 | | -expect(result.candidates.some((candidate) => candidate.idHint === "demo-pack")).toBe(true); |
| 1696 | +expect(result.candidates.map((candidate) => candidate.idHint)).toContain("demo-pack"); |
1697 | 1697 | expect(result.diagnostics).not.toEqual( |
1698 | 1698 | expect.arrayContaining([ |
1699 | 1699 | expect.objectContaining({ |
@@ -1804,12 +1804,12 @@ describe("discoverOpenClawPlugins", () => {
|
1804 | 1804 | |
1805 | 1805 | const env = buildDiscoveryEnvWithOverrides(stateDir); |
1806 | 1806 | const first = discoverWithEnv({ env }); |
1807 | | -expect(first.candidates.some((candidate) => candidate.idHint === "fresh")).toBe(true); |
| 1807 | +expect(first.candidates.map((candidate) => candidate.idHint)).toContain("fresh"); |
1808 | 1808 | |
1809 | 1809 | fs.rmSync(pluginPath, { force: true }); |
1810 | 1810 | |
1811 | 1811 | const second = discoverWithEnv({ env }); |
1812 | | -expect(second.candidates.some((candidate) => candidate.idHint === "fresh")).toBe(false); |
| 1812 | +expect(second.candidates.map((candidate) => candidate.idHint)).not.toContain("fresh"); |
1813 | 1813 | }); |
1814 | 1814 | |
1815 | 1815 | it("discovers bundled and global plugins for each workspace-specific scan", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。