





























@@ -33,7 +33,9 @@ const mocks = vi.hoisted(() => ({
3333),
3434resolveInstalledManifestRegistryIndexFingerprint: vi.fn(() => "test-installed-index"),
3535loadBundledCapabilityRuntimeRegistry: vi.fn(),
36-loadPluginRegistrySnapshot: vi.fn<() => { plugins: Array<Record<string, unknown>> }>(() => ({
36+loadPluginRegistrySnapshot: vi.fn<
37+(_params?: unknown) => { plugins: Array<Record<string, unknown>> }
38+>(() => ({
3739plugins: [],
3840})),
3941withBundledPluginAllowlistCompat: vi.fn(
@@ -65,13 +67,21 @@ vi.mock("./manifest-registry-installed.js", () => ({
6567mocks.resolveInstalledManifestRegistryIndexFingerprint,
6668}));
676970+vi.mock("./manifest-registry.js", async (importOriginal) => {
71+const actual = await importOriginal<typeof import("./manifest-registry.js")>();
72+return {
73+ ...actual,
74+loadPluginManifestRegistry: mocks.loadPluginManifestRegistry,
75+};
76+});
77+6878vi.mock("./plugin-registry.js", async (importOriginal) => {
6979const actual = await importOriginal<typeof import("./plugin-registry.js")>();
7080return {
7181 ...actual,
7282loadPluginRegistrySnapshot: mocks.loadPluginRegistrySnapshot,
7383loadPluginRegistrySnapshotWithMetadata: (params?: { index?: unknown }) => {
74-const snapshot = (params?.index ?? mocks.loadPluginRegistrySnapshot()) as {
84+const snapshot = (params?.index ?? mocks.loadPluginRegistrySnapshot(params)) as {
7585plugins?: Array<Record<string, unknown>>;
7686};
7787return {
@@ -138,8 +148,6 @@ function expectBundledCompatLoadPath(params: {
138148expect.objectContaining({
139149config: params.cfg,
140150env: process.env,
141-includeDisabled: true,
142-index: expect.any(Object),
143151}),
144152);
145153expect(mocks.withBundledPluginEnablementCompat).toHaveBeenCalledWith({
@@ -1102,8 +1110,6 @@ describe("resolvePluginCapabilityProviders", () => {
11021110expect.objectContaining({
11031111config: {},
11041112env: process.env,
1105-includeDisabled: true,
1106-index: expect.any(Object),
11071113}),
11081114);
11091115expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith({
@@ -1230,8 +1236,6 @@ describe("resolvePluginCapabilityProviders", () => {
12301236expect.objectContaining({
12311237config: cfg,
12321238env: process.env,
1233-includeDisabled: true,
1234-index: expect.any(Object),
12351239}),
12361240);
12371241expect(mocks.withBundledPluginAllowlistCompat).toHaveBeenCalledWith({
@@ -1265,8 +1269,6 @@ describe("resolvePluginCapabilityProviders", () => {
12651269expect.objectContaining({
12661270config: {},
12671271env: process.env,
1268-includeDisabled: true,
1269-index: expect.any(Object),
12701272}),
12711273);
12721274expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。