
























@@ -1013,6 +1013,12 @@ describe("scanBundledPluginRuntimeDeps config policy", () => {
10131013includeConfiguredChannels: false,
10141014expectedDeps: [],
10151015},
1016+{
1017+name: "includes selected memory slot bundled plugins behind restrictive allowlists",
1018+config: { plugins: { allow: ["browser"], slots: { memory: "alpha" } } },
1019+includeConfiguredChannels: false,
1020+expectedDeps: ["alpha-runtime@1.0.0"],
1021+},
10161022{
10171023name: "does not let explicit plugin entries bypass restrictive allowlists",
10181024config: { plugins: { allow: ["browser"], entries: { alpha: { enabled: true } } } },
@@ -2562,6 +2568,40 @@ describe("ensureBundledPluginRuntimeDeps", () => {
25622568expect(installRoot).not.toBe(pluginRoot);
25632569});
256425702571+it("installs runtime deps for the default memory slot bundled plugin", () => {
2572+const packageRoot = makeTempDir();
2573+const pluginRoot = writeBundledPluginPackage({
2574+ packageRoot,
2575+pluginId: "memory-core",
2576+deps: { chokidar: "^5.0.0" },
2577+});
2578+const calls: BundledRuntimeDepsInstallParams[] = [];
2579+2580+const result = ensureBundledPluginRuntimeDeps({
2581+env: {},
2582+config: {},
2583+installDeps: (params) => {
2584+calls.push(params);
2585+},
2586+pluginId: "memory-core",
2587+ pluginRoot,
2588+});
2589+2590+expect(result).toEqual({
2591+installedSpecs: ["chokidar@^5.0.0"],
2592+retainSpecs: ["chokidar@^5.0.0"],
2593+});
2594+const installRoot = resolveBundledRuntimeDependencyInstallRoot(pluginRoot, { env: {} });
2595+expect(calls).toEqual([
2596+{
2597+ installRoot,
2598+missingSpecs: ["chokidar@^5.0.0"],
2599+installSpecs: ["chokidar@^5.0.0"],
2600+},
2601+]);
2602+expect(installRoot).not.toBe(pluginRoot);
2603+});
2604+25652605it("repairs external staged deps even when packaged plugin-local deps are present", () => {
25662606const packageRoot = makeTempDir();
25672607const extensionsRoot = path.join(packageRoot, "dist", "extensions");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。