test: dedupe plugin runtime and provider suites

This commit is contained in:
Peter Steinberger
2026-03-28 02:58:52 +00:00
parent b34b03dd9e
commit 39f6fe9ab1
34 changed files with 1178 additions and 913 deletions

View File

@@ -30,6 +30,10 @@ function createRegistry(services: OpenClawPluginService[]) {
return registry;
}
function createServiceConfig() {
return {} as Parameters<typeof startPluginServices>[0]["config"];
}
function expectServiceContext(
ctx: OpenClawPluginServiceContext,
config: Parameters<typeof startPluginServices>[0]["config"],
@@ -88,7 +92,7 @@ describe("startPluginServices", () => {
const stops: string[] = [];
const contexts: OpenClawPluginServiceContext[] = [];
const config = {} as Parameters<typeof startPluginServices>[0]["config"];
const config = createServiceConfig();
const handle = await startPluginServices({
registry: createRegistry([
createTrackingService("service-a", { starts, stops, contexts }),
@@ -123,7 +127,7 @@ describe("startPluginServices", () => {
createTrackingService("service-ok", { stopSpy: stopOk }),
createTrackingService("service-stop-fail", { stopSpy: stopThrows }),
]),
config: {} as Parameters<typeof startPluginServices>[0]["config"],
config: createServiceConfig(),
});
await handle.stop();