mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 06:50:43 +00:00
test: tighten plugin provider array assertions
This commit is contained in:
@@ -1322,7 +1322,7 @@ describe("installPluginFromNpmSpec", () => {
|
||||
}
|
||||
expect(stableCorrection.npmResolution?.version).toBe("2026.5.3-1");
|
||||
expect(stableCorrection.npmResolution?.resolvedSpec).toBe("@openclaw/voice-call@2026.5.3-1");
|
||||
expect(correctionWarnings).toEqual([]);
|
||||
expect(correctionWarnings).toStrictEqual([]);
|
||||
|
||||
runCommandWithTimeoutMock.mockReset();
|
||||
const prereleaseOnlyNpmRoot = path.join(suiteTempRootTracker.makeTempDir(), "npm");
|
||||
|
||||
@@ -238,7 +238,7 @@ describe("publishable plugin npm package install security scan", () => {
|
||||
unexpectedCriticalFindings.push(...result.unexpectedCriticalFindings);
|
||||
}
|
||||
|
||||
expect(unexpectedCriticalFindings.toSorted()).toEqual([]);
|
||||
expect(unexpectedCriticalFindings.toSorted()).toStrictEqual([]);
|
||||
expect([...reviewedCriticalFindings].toSorted()).toEqual(
|
||||
[...expectedReviewedCriticalFindings].toSorted(),
|
||||
);
|
||||
|
||||
@@ -601,7 +601,7 @@ describe("provider-runtime", () => {
|
||||
store: { version: 1, profiles: {} },
|
||||
},
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
expect(resolvePluginProvidersMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -1821,7 +1821,7 @@ describe("provider-runtime", () => {
|
||||
tools: [DEMO_TOOL],
|
||||
}),
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
|
||||
expect(
|
||||
normalizeProviderResolvedModelWithPlugin({
|
||||
|
||||
@@ -674,14 +674,14 @@ describe("resolvePluginProviders", () => {
|
||||
env: {} as NodeJS.ProcessEnv,
|
||||
onlyPluginIds: [],
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
expect(
|
||||
resolveDiscoveredProviderPluginIds({
|
||||
config: {},
|
||||
env: {} as NodeJS.ProcessEnv,
|
||||
onlyPluginIds: [],
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
@@ -1169,7 +1169,7 @@ describe("resolvePluginProviders", () => {
|
||||
},
|
||||
},
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("does not activate explicit runtime owners disabled in config", () => {
|
||||
@@ -1194,7 +1194,7 @@ describe("resolvePluginProviders", () => {
|
||||
},
|
||||
},
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("does not activate explicit runtime owners outside the allowlist", () => {
|
||||
@@ -1217,7 +1217,7 @@ describe("resolvePluginProviders", () => {
|
||||
},
|
||||
},
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("uses setup.providers to keep explicit provider owners on the setup path", () => {
|
||||
@@ -1326,7 +1326,7 @@ describe("resolvePluginProviders", () => {
|
||||
includeUntrustedWorkspacePlugins: false,
|
||||
});
|
||||
|
||||
expect(providers).toEqual([]);
|
||||
expect(providers).toStrictEqual([]);
|
||||
expect(loadOpenClawPluginsMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -1350,7 +1350,7 @@ describe("resolvePluginProviders", () => {
|
||||
includeUntrustedWorkspacePlugins: false,
|
||||
});
|
||||
|
||||
expect(providers).toEqual([]);
|
||||
expect(providers).toStrictEqual([]);
|
||||
expect(resolveRuntimePluginRegistryMock).not.toHaveBeenCalled();
|
||||
expect(getRuntimePluginRegistryForLoadOptionsMock).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -1374,7 +1374,7 @@ describe("resolvePluginProviders", () => {
|
||||
activate: true,
|
||||
});
|
||||
|
||||
expect(providers).toEqual([]);
|
||||
expect(providers).toStrictEqual([]);
|
||||
expect(resolveRuntimePluginRegistryMock).not.toHaveBeenCalled();
|
||||
expect(getRuntimePluginRegistryForLoadOptionsMock).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -1401,7 +1401,7 @@ describe("resolvePluginProviders", () => {
|
||||
activate: true,
|
||||
});
|
||||
|
||||
expect(providers).toEqual([]);
|
||||
expect(providers).toStrictEqual([]);
|
||||
expect(resolveRuntimePluginRegistryMock).not.toHaveBeenCalled();
|
||||
expect(getRuntimePluginRegistryForLoadOptionsMock).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -1432,7 +1432,7 @@ describe("resolvePluginProviders", () => {
|
||||
},
|
||||
includeUntrustedWorkspacePlugins: false,
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("does not auto-activate explicitly disabled trusted workspace runtime owners", () => {
|
||||
@@ -1460,7 +1460,7 @@ describe("resolvePluginProviders", () => {
|
||||
},
|
||||
includeUntrustedWorkspacePlugins: false,
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("keeps legacy CLI backend ownership as the explicit provider fallback", () => {
|
||||
|
||||
@@ -96,7 +96,7 @@ describe("runtime TaskFlow", () => {
|
||||
});
|
||||
|
||||
expect(otherTaskFlow.get(created.flowId)).toBeUndefined();
|
||||
expect(otherTaskFlow.list()).toEqual([]);
|
||||
expect(otherTaskFlow.list()).toStrictEqual([]);
|
||||
|
||||
const child = ownerTaskFlow.runTask({
|
||||
flowId: created.flowId,
|
||||
|
||||
@@ -2752,7 +2752,7 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
|
||||
expect(installPluginFromNpmSpecMock).not.toHaveBeenCalled();
|
||||
expect(result.changed).toBe(expectedChanged);
|
||||
expect(result.summary.switchedToNpm).toEqual([]);
|
||||
expect(result.summary.switchedToNpm).toStrictEqual([]);
|
||||
expect(result.config.plugins?.load?.paths).toEqual(expectedLoadPaths);
|
||||
expectBundledPathInstall({
|
||||
install: result.config.plugins?.installs?.feishu,
|
||||
@@ -2886,8 +2886,8 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
);
|
||||
expect(result.changed).toBe(true);
|
||||
expect(result.summary.switchedToNpm).toEqual(["legacy-chat"]);
|
||||
expect(result.summary.errors).toEqual([]);
|
||||
expect(result.config.plugins?.load?.paths).toEqual([]);
|
||||
expect(result.summary.errors).toStrictEqual([]);
|
||||
expect(result.config.plugins?.load?.paths).toStrictEqual([]);
|
||||
expect(result.config.plugins?.installs?.["legacy-chat"]).toMatchObject({
|
||||
source: "npm",
|
||||
spec: "@openclaw/legacy-chat",
|
||||
@@ -2999,9 +2999,9 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
expect(installPluginFromNpmSpecMock).not.toHaveBeenCalled();
|
||||
expect(result.changed).toBe(true);
|
||||
expect(result.summary.switchedToClawHub).toEqual(["legacy-chat"]);
|
||||
expect(result.summary.switchedToNpm).toEqual([]);
|
||||
expect(result.summary.errors).toEqual([]);
|
||||
expect(result.config.plugins?.load?.paths).toEqual([]);
|
||||
expect(result.summary.switchedToNpm).toStrictEqual([]);
|
||||
expect(result.summary.errors).toStrictEqual([]);
|
||||
expect(result.config.plugins?.load?.paths).toStrictEqual([]);
|
||||
expect(result.config.plugins?.installs?.["legacy-chat"]).toMatchObject({
|
||||
source: "clawhub",
|
||||
spec: "clawhub:legacy-chat@2026.5.1-beta.2",
|
||||
@@ -3082,12 +3082,12 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
}),
|
||||
);
|
||||
expect(result.changed).toBe(true);
|
||||
expect(result.summary.switchedToClawHub).toEqual([]);
|
||||
expect(result.summary.switchedToClawHub).toStrictEqual([]);
|
||||
expect(result.summary.switchedToNpm).toEqual(["legacy-chat"]);
|
||||
expect(result.summary.warnings).toEqual([
|
||||
"ClawHub clawhub:legacy-chat@2026.5.1-beta.2 unavailable for legacy-chat; falling back to npm @openclaw/legacy-chat.",
|
||||
]);
|
||||
expect(result.summary.errors).toEqual([]);
|
||||
expect(result.summary.errors).toStrictEqual([]);
|
||||
expect(result.config.plugins?.installs?.["legacy-chat"]).toMatchObject({
|
||||
source: "npm",
|
||||
spec: "@openclaw/legacy-chat",
|
||||
|
||||
@@ -70,7 +70,7 @@ describe("resolveManifestDeclaredWebProviderCandidatePluginIds", () => {
|
||||
configKey: "webSearch",
|
||||
onlyPluginIds: [],
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
expect(mocks.loadPluginManifestRegistryForInstalledIndex).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ describe("resolveManifestDeclaredWebProviderCandidatePluginIds", () => {
|
||||
configKey: "webSearch",
|
||||
onlyPluginIds: ["missing-plugin"],
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
expect(mocks.loadPluginMetadataSnapshot).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
@@ -105,7 +105,7 @@ describe("resolveManifestDeclaredWebProviderCandidatePluginIds", () => {
|
||||
configKey: "webSearch",
|
||||
origin: "bundled",
|
||||
}),
|
||||
).toEqual([]);
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("derives provider candidates from a single manifest-registry read", () => {
|
||||
|
||||
Reference in New Issue
Block a user