Files
factorio-clusterio/test/host/BaseHostPlugin.js
T
Hornwitser ee9c200ebf Implement host plugins
Add ability to define plugin code that runs in the context of a host,
starts up with the host does, and stops when the host shuts down.
2023-11-25 19:18:33 +01:00

23 lines
716 B
JavaScript

"use strict";
const assert = require("assert").strict;
const mock = require("../mock");
const host = require("@clusterio/host");
describe("host/src/BaseHostPlugin", function() {
describe("class BaseHostPlugin", function() {
let hostPlugin;
it("should be constructible", async function() {
hostPlugin = new host.BaseHostPlugin({}, new mock.MockHost(), new mock.MockLogger());
await hostPlugin.init();
});
it("should define defaults for hooks", async function() {
await hostPlugin.onHostConfigFieldChanged();
await hostPlugin.onMetrics();
await hostPlugin.onShutdown();
hostPlugin.onControllerConnectionEvent("connect");
await hostPlugin.onPrepareControllerDisconnect();
});
});
});