factorioServer relative paths instead of absolute

This commit is contained in:
Danielv123 committed 2018-03-30 11:07:26 +02:00
1 parent d9d8905d02
commit 507c0afa98
2 files changed
+7 -7

No files matched your search

+3 -3
View File
@@ -57,15 +57,15 @@ describe("factorioServer/index.js", ()=>{
it("creates a map file as instanceDirectory/saves/map.zip", async ()=>{
let relativePath = __dirname.replace(appRootPath, "").substr(1);
let server = new factorioServer({
instanceDirectory: path.resolve(relativePath, "_testData_createMap"),
instanceDirectory: path.join(relativePath, "_testData_createMap"),
instanceName: "Unit testing instance",
});
await server.initialize();
console.log("Relative path: "+relativePath)
let maps = fs.readdirSync(path.resolve(relativePath, "_testData_createMap", "saves"));
let maps = fs.readdirSync(path.join(relativePath, "_testData_createMap", "saves"));
assert.equal(maps.length, 0);
await server.createMap();
let maps2 = fs.readdirSync(path.resolve(relativePath, "_testData_createMap", "saves"));
let maps2 = fs.readdirSync(path.join(relativePath, "_testData_createMap", "saves"));
assert(maps2.includes("map.zip"));
server.deleteInstance();