mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Ctl ended up calling its main class for "Control" for historical
reasons, along with its config file and plugin entrypoint.
The plugin entrypoint was renamed to ctl in 808eda0513. This
finishes that renaming by also renaming the main class, default config
file, config-control command, and main entrypoint.
The config-control command is renamed to config to be consistent with
the host and controller's config commands.
The term "control" is still kept in the config and message locations as
a common specifier for both ctl and web_ui.
49 lines
1.9 KiB
JavaScript
49 lines
1.9 KiB
JavaScript
import * as lib from "@clusterio/lib";
|
|
import assert from "node:assert/strict";
|
|
|
|
// Each migration test should indicate which version introduced the migration
|
|
|
|
describe("lib/config/definitions/migrations", function() {
|
|
describe("Controller Config", function() {
|
|
it("should migrate 'external_address' to 'public_url'", function() { // Alpha 19
|
|
const config = lib.ControllerConfig.fromJSON({
|
|
"controller.external_address": "https://example.com:4000",
|
|
}, "controller");
|
|
|
|
assert.equal(config.get("controller.public_url"), "https://example.com:4000",
|
|
"public_url contains the wrong value");
|
|
assert.equal(config.fields["controller.external_address"], undefined,
|
|
"external_address was not removed");
|
|
});
|
|
});
|
|
describe("Host Config", function() {
|
|
|
|
});
|
|
describe("Instance Config", function() {
|
|
it("should migrate boolean sync to string enum", function() { // Alpha 19
|
|
const configTrue = lib.InstanceConfig.fromJSON({
|
|
"factorio.sync_adminlist": true,
|
|
"factorio.sync_whitelist": true,
|
|
"factorio.sync_banlist": true,
|
|
}, "controller");
|
|
|
|
assert.equal(configTrue.get("factorio.sync_adminlist"), "enabled", "sync_adminlist contains wrong value");
|
|
assert.equal(configTrue.get("factorio.sync_whitelist"), "enabled", "sync_adminlist contains wrong value");
|
|
assert.equal(configTrue.get("factorio.sync_banlist"), "enabled", "sync_adminlist contains wrong value");
|
|
|
|
const configFalse = lib.InstanceConfig.fromJSON({
|
|
"factorio.sync_adminlist": false,
|
|
"factorio.sync_whitelist": false,
|
|
"factorio.sync_banlist": false,
|
|
}, "controller");
|
|
|
|
assert.equal(configFalse.get("factorio.sync_adminlist"), "disabled", "sync_adminlist contains wrong value");
|
|
assert.equal(configFalse.get("factorio.sync_whitelist"), "disabled", "sync_adminlist contains wrong value");
|
|
assert.equal(configFalse.get("factorio.sync_banlist"), "disabled", "sync_adminlist contains wrong value");
|
|
});
|
|
});
|
|
describe("Ctl Config", function() {
|
|
|
|
});
|
|
});
|