























@@ -475,8 +475,10 @@ describe("plugins cli install", () => {
475475nextConfig: enabledCfg,
476476}),
477477);
478-expect(runtimeLogs.some((line) => line.includes("slot adjusted"))).toBe(true);
479-expect(runtimeLogs.some((line) => line.includes("Installed plugin: alpha"))).toBe(true);
478+expect(runtimeLogs).toEqual(expect.arrayContaining([expect.stringContaining("slot adjusted")]));
479+expect(runtimeLogs).toEqual(
480+expect.arrayContaining([expect.stringContaining("Installed plugin: alpha")]),
481+);
480482});
481483482484it("passes force through as overwrite mode for marketplace installs", async () => {
@@ -539,7 +541,9 @@ describe("plugins cli install", () => {
539541}),
540542});
541543expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);
542-expect(runtimeLogs.some((line) => line.includes("Installed plugin: demo"))).toBe(true);
544+expect(runtimeLogs).toEqual(
545+expect.arrayContaining([expect.stringContaining("Installed plugin: demo")]),
546+);
543547expect(installPluginFromNpmSpec).not.toHaveBeenCalled();
544548});
545549@@ -618,7 +622,9 @@ describe("plugins cli install", () => {
618622});
619623expect(enablePluginInConfig).not.toHaveBeenCalled();
620624expect(applyExclusiveSlotSelection).not.toHaveBeenCalled();
621-expect(runtimeLogs.some((line) => line.includes("requires configuration first"))).toBe(true);
625+expect(runtimeLogs).toEqual(
626+expect.arrayContaining([expect.stringContaining("requires configuration first")]),
627+);
622628});
623629624630it("enables config-gated bundled installs when provider-backed config is explicit", async () => {
@@ -656,7 +662,9 @@ describe("plugins cli install", () => {
656662657663expect(enablePluginInConfig).toHaveBeenCalled();
658664expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);
659-expect(runtimeLogs.some((line) => line.includes("requires configuration first"))).toBe(false);
665+expect(runtimeLogs).not.toEqual(
666+expect.arrayContaining([expect.stringContaining("requires configuration first")]),
667+);
660668});
661669662670it("passes force through as overwrite mode for ClawHub installs", async () => {
@@ -1807,7 +1815,9 @@ describe("plugins cli install", () => {
18071815path: localHookDir,
18081816}),
18091817);
1810-expect(runtimeLogs.some((line) => line.includes("Installed hook pack: demo-hooks"))).toBe(true);
1818+expect(runtimeLogs).toEqual(
1819+expect.arrayContaining([expect.stringContaining("Installed hook pack: demo-hooks")]),
1820+);
18111821});
1812182218131823it("still falls back to npm hook pack when dangerous force unsafe install is set for non-security errors", async () => {
@@ -1862,7 +1872,9 @@ describe("plugins cli install", () => {
18621872spec: "@acme/demo-hooks",
18631873}),
18641874);
1865-expect(runtimeLogs.some((line) => line.includes("Installed hook pack: demo-hooks"))).toBe(true);
1875+expect(runtimeLogs).toEqual(
1876+expect.arrayContaining([expect.stringContaining("Installed hook pack: demo-hooks")]),
1877+);
18661878});
1867187918681880it("does not fall back to npm when explicit ClawHub rejects a real package", async () => {
@@ -1899,7 +1911,9 @@ describe("plugins cli install", () => {
18991911}),
19001912);
19011913expect(writeConfigFile).toHaveBeenCalledWith(installedCfg);
1902-expect(runtimeLogs.some((line) => line.includes("Installed hook pack: demo-hooks"))).toBe(true);
1914+expect(runtimeLogs).toEqual(
1915+expect.arrayContaining([expect.stringContaining("Installed hook pack: demo-hooks")]),
1916+);
19031917});
1904191819051919it("passes force through as overwrite mode for hook-pack npm fallback installs", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。