mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Move filepath into config class
This commit is contained in:
12 files changed
+51
-62
No files matched your search
@@ -28,7 +28,7 @@ describe("controller/src/Controller", function() {
|
||||
/** @type {Controller} */
|
||||
let controller, mockInstanceConfig;
|
||||
before(async function() {
|
||||
controller = new Controller({}, [], "", new ControllerConfig("controller"));
|
||||
controller = new Controller({}, [], new ControllerConfig("controller"));
|
||||
mockInstanceConfig = new MockInstanceConfig(new Map([
|
||||
["instance.id", 100], ["instance.name", "test"], ["factorio.settings", []],
|
||||
]));
|
||||
|
||||
@@ -10,7 +10,7 @@ describe("controller/src/WsServer", function() {
|
||||
before(function() {
|
||||
let config = new ControllerConfig("controller");
|
||||
config.set("controller.trusted_proxies", "127.0.0.0/8, ::1");
|
||||
let controller = new Controller({}, [], "", config);
|
||||
let controller = new Controller({}, [], config);
|
||||
wsServer = controller.wsServer;
|
||||
});
|
||||
describe(".remoteAddr()", function() {
|
||||
|
||||
+7
-6
@@ -10,13 +10,14 @@ const { _discoverInstances } = require("@clusterio/host/dist/node/src/Host");
|
||||
describe("Host testing", function() {
|
||||
describe("discoverInstances()", function() {
|
||||
it("should discover test instance", async function() {
|
||||
let instancePath = path.join("test", "file", "instances");
|
||||
let instanceInfos = await _discoverInstances(instancePath);
|
||||
const instancePath = path.join("test", "file", "instances");
|
||||
const instanceInfos = await _discoverInstances(instancePath);
|
||||
|
||||
let referenceConfig = new lib.InstanceConfig("host");
|
||||
referenceConfig.set("instance.id", 1);
|
||||
referenceConfig.set("instance.name", "test");
|
||||
referenceConfig.dirty = false;
|
||||
const configPath = path.join(instancePath, "test", "instance.json");
|
||||
const referenceConfig = new lib.InstanceConfig("host", {
|
||||
"instance.id": 1,
|
||||
"instance.name": "test",
|
||||
}, configPath);
|
||||
|
||||
assert.deepEqual(instanceInfos, new Map([
|
||||
[1, {
|
||||
|
||||
@@ -23,7 +23,7 @@ function connectHost(controller, hostId, plugins) {
|
||||
controller.wsServer.hostConnections.set(hostId, hostConnection);
|
||||
const hostConfig = new lib.HostConfig("host");
|
||||
hostConfig.set("host.id", hostId);
|
||||
return new Host(hostSide, "invalid", hostConfig, undefined, []);
|
||||
return new Host(hostSide, hostConfig, undefined, []);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,12 +107,7 @@ describe("Integration of link routing", function() {
|
||||
let controlB;
|
||||
|
||||
beforeEach(function() {
|
||||
controller = new Controller(
|
||||
{},
|
||||
[],
|
||||
"invalid",
|
||||
new lib.ControllerConfig("controller")
|
||||
);
|
||||
controller = new Controller({}, [], new lib.ControllerConfig("controller"));
|
||||
hostA = connectHost(controller, 10, []);
|
||||
hostB = connectHost(controller, 20, []);
|
||||
instanceA1 = connectInstance(controller, hostA, 11);
|
||||
|
||||
Reference in new issue
Block a user