test: check plugin service failure logs

This commit is contained in:
Shakker
2026-05-11 16:10:06 +01:00
parent 691440f061
commit a150e35928

View File

@@ -169,15 +169,15 @@ describe("startPluginServices", () => {
await handle.stop();
expect(mockedLogger.error).toHaveBeenCalledWith(
expect.stringContaining(
"plugin service failed (service-start-fail, plugin=plugin:test, root=/plugins/test-plugin):",
),
);
expect(mockedLogger.error.mock.calls).toEqual([
[
"plugin service failed (service-start-fail, plugin=plugin:test, root=/plugins/test-plugin): start failed",
],
]);
expect(mockedLogger.error.mock.calls[0]?.[0]).not.toContain("\n");
expect(mockedLogger.warn).toHaveBeenCalledWith(
expect.stringContaining("plugin service stop failed (service-stop-fail):"),
);
expect(mockedLogger.warn.mock.calls).toEqual([
["plugin service stop failed (service-stop-fail): Error: stop failed"],
]);
expect(stopOk).toHaveBeenCalledOnce();
expect(stopThrows).toHaveBeenCalledOnce();
});