mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Move instance directory to Instance class
Replace the instancedirectory variable with an Instance class that holds the directory and has a .path() to get paths relative to the instance directory.
This commit is contained in:
1 parent
ec223e9d9e
commit
1ba9e68603
4 files changed
+148
-97
No files matched your search
@@ -1,8 +1,24 @@
|
||||
const assert = require('assert').strict;
|
||||
const path = require('path');
|
||||
|
||||
const client = require("../client");
|
||||
|
||||
describe("Client testing", function() {
|
||||
describe("class Instance", function() {
|
||||
let instance = new client._Instance("dir", "foo")
|
||||
it("should give the name on .name", function() {
|
||||
assert.equal(instance.name, "foo");
|
||||
})
|
||||
|
||||
it("should give the path to it on .path()", function() {
|
||||
assert.equal(instance.path(), "dir");
|
||||
})
|
||||
|
||||
it("should join path on .path(...parts)", function() {
|
||||
assert.equal(instance.path("bar"), path.join("dir", "bar"));
|
||||
})
|
||||
});
|
||||
|
||||
describe("randomDynamicPort()", function() {
|
||||
it("should return a port number", function() {
|
||||
let port = client._randomDynamicPort()
|
||||
|
||||
Reference in new issue
Block a user