


























@@ -78,6 +78,14 @@ function expectServiceLifecycleState(params: {
7878expectServiceContexts(params.contexts, params.config);
7979}
808081+function requireLoggerErrorMessage(index = 0): string {
82+const call = mockedLogger.error.mock.calls.at(index);
83+if (!call) {
84+throw new Error(`expected logger error call ${index}`);
85+}
86+return call[0];
87+}
88+8189async function startTrackingServices(params: {
8290services: OpenClawPluginService[];
8391config?: Parameters<typeof startPluginServices>[0]["config"];
@@ -174,7 +182,7 @@ describe("startPluginServices", () => {
174182"plugin service failed (service-start-fail, plugin=plugin:test, root=/plugins/test-plugin): start failed",
175183],
176184]);
177-expect(mockedLogger.error.mock.calls[0]?.[0]).not.toContain("\n");
185+expect(requireLoggerErrorMessage()).not.toContain("\n");
178186expect(mockedLogger.warn.mock.calls).toEqual([
179187["plugin service stop failed (service-stop-fail): Error: stop failed"],
180188]);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。