

























@@ -1970,7 +1970,7 @@ describe("installPluginFromArchive", () => {
19701970);
19711971});
197219721973-it("surfaces plugin scanner findings from before_install", async () => {
1973+it("surfaces plugin lifecycle findings from before_install", async () => {
19741974const handler = vi.fn().mockReturnValue({
19751975findings: [
19761976{
@@ -2052,10 +2052,10 @@ describe("installPluginFromArchive", () => {
20522052expect(requests[1]?.request.requestedSpecifier).toBe(pluginDir);
20532053});
205420542055-it("blocks plugin install when before_install rejects dangerous-looking source", async () => {
2055+it("blocks plugin install when before_install rejects the staged source", async () => {
20562056const handler = vi.fn().mockReturnValue({
20572057block: true,
2058-blockReason: "Blocked by enterprise policy",
2058+blockReason: "Blocked by plugin lifecycle hook",
20592059});
20602060initializeGlobalHookRunner(createMockPluginRegistry([{ hookName: "before_install", handler }]));
20612061@@ -2078,7 +2078,7 @@ describe("installPluginFromArchive", () => {
2078207820792079expect(result.ok).toBe(false);
20802080if (!result.ok) {
2081-expect(result.error).toBe("Blocked by enterprise policy");
2081+expect(result.error).toBe("Blocked by plugin lifecycle hook");
20822082expect(result.code).toBe(PLUGIN_INSTALL_ERROR_CODE.SECURITY_SCAN_BLOCKED);
20832083}
20842084expect(handler).toHaveBeenCalledTimes(1);
@@ -2098,14 +2098,14 @@ describe("installPluginFromArchive", () => {
20982098extensions: ["index.js"],
20992099});
21002100expect(
2101-warnings.some((w) => w.includes("blocked by plugin hook: Blocked by enterprise policy")),
2101+warnings.some((w) => w.includes("blocked by plugin hook: Blocked by plugin lifecycle hook")),
21022102).toBe(true);
21032103});
2104210421052105it("keeps before_install hook blocks even when dangerous force unsafe install is set", async () => {
21062106const handler = vi.fn().mockReturnValue({
21072107block: true,
2108-blockReason: "Blocked by enterprise policy",
2108+blockReason: "Blocked by plugin lifecycle hook",
21092109});
21102110initializeGlobalHookRunner(createMockPluginRegistry([{ hookName: "before_install", handler }]));
21112111@@ -2132,7 +2132,7 @@ describe("installPluginFromArchive", () => {
2132213221332133expect(result.ok).toBe(false);
21342134if (!result.ok) {
2135-expect(result.error).toBe("Blocked by enterprise policy");
2135+expect(result.error).toBe("Blocked by plugin lifecycle hook");
21362136expect(result.code).toBe(PLUGIN_INSTALL_ERROR_CODE.SECURITY_SCAN_BLOCKED);
21372137}
21382138expect(
@@ -2144,7 +2144,7 @@ describe("installPluginFromArchive", () => {
21442144).toBe(false);
21452145expect(
21462146warnings.some((warning) =>
2147-warning.includes("blocked by plugin hook: Blocked by enterprise policy"),
2147+warning.includes("blocked by plugin hook: Blocked by plugin lifecycle hook"),
21482148),
21492149).toBe(true);
21502150});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。