fix(ticket116): isoler crash plugin hello-plugin + erreur explicite UI
This commit is contained in:
@ -195,6 +195,39 @@ describe("loadPlugins", () => {
|
||||
expect((globalThis as Record<string, unknown>).__helloArchiveCommandRan).toBe(true);
|
||||
});
|
||||
|
||||
it("confines a malformed runtime catalog entry and still loads healthy plugins", async () => {
|
||||
const bundle = dataUrl(`
|
||||
export function activate(ctx) {
|
||||
globalThis.__healthyPluginActivated = ctx.pluginId;
|
||||
}
|
||||
`);
|
||||
|
||||
const { registry, failures } = await loadPlugins(
|
||||
[
|
||||
null,
|
||||
entry({
|
||||
id: "dev.acme.healthy",
|
||||
displayName: "Healthy",
|
||||
bundleUrl: bundle,
|
||||
contributes: {
|
||||
menus: [null],
|
||||
menuItems: [null, { id: "x", targetMenuId: "panels", label: "X" }],
|
||||
layouts: [null, { label: "Missing type" }],
|
||||
} as unknown as PluginContributionDto,
|
||||
}),
|
||||
] as unknown as PluginRuntimePlugin[],
|
||||
gateways,
|
||||
);
|
||||
|
||||
expect(registry.list().map((p) => p.pluginId)).toEqual(["dev.acme.healthy"]);
|
||||
expect(failures).toEqual([
|
||||
{ pluginId: "<unknown-plugin>", reason: expect.stringContaining("bundle URL") },
|
||||
]);
|
||||
expect((globalThis as Record<string, unknown>).__healthyPluginActivated).toBe(
|
||||
"dev.acme.healthy",
|
||||
);
|
||||
});
|
||||
|
||||
it("calls dispose() on removal (best-effort)", async () => {
|
||||
const bundle = dataUrl(`
|
||||
export function activate(ctx) {
|
||||
|
||||
Reference in New Issue
Block a user