mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Move BaseControllerPlugin to controller/src/BaseControllerPlugin.ts Move BaseInstancePlugin to host/src/BaseInstancePlugin.ts Move BaseControlPlugin to ctl/src/BaseCtlPlugin.ts Move BaseWebPlugin to web_ui/src/BaseWebPlugin.ts This solves the circular package dependency problem of the base plugins needing types that are available only in the dependencies to lib.
23 lines
924 B
JavaScript
23 lines
924 B
JavaScript
"use strict";
|
|
const mock = require("../mock");
|
|
const controller = require("@clusterio/controller");
|
|
|
|
describe("controller/src/BaseControllerPlugin", function() {
|
|
describe("class BaseControllerPlugin", function() {
|
|
let controllerPlugin;
|
|
it("should be constructible", async function() {
|
|
controllerPlugin = new controller.BaseControllerPlugin({}, {}, {}, new mock.MockLogger());
|
|
await controllerPlugin.init();
|
|
});
|
|
it("should define defaults for hooks", async function() {
|
|
await controllerPlugin.onInstanceStatusChanged({}, "running", "initialized");
|
|
await controllerPlugin.onControllerConfigFieldChanged({}, "foo", null);
|
|
await controllerPlugin.onInstanceConfigFieldChanged({}, {}, "foo", null);
|
|
await controllerPlugin.onMetrics();
|
|
await controllerPlugin.onShutdown();
|
|
controllerPlugin.onHostConnectionEvent({}, "connect");
|
|
await controllerPlugin.onPrepareHostDisconnect({});
|
|
});
|
|
});
|
|
});
|