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:
Hornwitser committed 2019-09-15 13:43:14 +02:00
1 parent ec223e9d9e
commit 1ba9e68603
4 files changed
+148 -97

No files matched your search

+16
View File
@@ -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()