diff --git a/.gitignore b/.gitignore index adb87bc8..87661d5e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,7 @@ static/pictures/spritesheet.js static/pictures/spritesheet.png static/external saves -/test/temp/ +/temp/ # weird pattern to ignore sharedPlugins except not ignore some core modules !sharedPlugins/ diff --git a/.travis.yml b/.travis.yml index 49ad77c6..b915da86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ before_install: - npm install -g codecov script: - npm run-script ci-cover - - cat test/temp/integration/log.txt + - cat temp/test/integration/log.txt - codecov -f coverage/lcov.info diff --git a/test/integration/index.js b/test/integration/index.js index 1fd04967..8173bf6e 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -32,11 +32,11 @@ let slaveProcess; let url = "https://localhost:4443/"; let token = jwt.sign({ id: "api" }, "TestSecretDoNotUse"); -let instancesDir = path.join("test", "temp", "instances"); -let databaseDir = path.join("test", "temp", "databse"); -let masterConfigPath = path.join("test", "temp", "master-integration.json"); -let slaveConfigPath = path.join("test", "temp", "slave-integration.json"); -let controlConfigPath = path.join("test", "temp", "control-integration.json"); +let instancesDir = path.join("temp", "test", "instances"); +let databaseDir = path.join("temp", "test", "databse"); +let masterConfigPath = path.join("temp", "test", "master-integration.json"); +let slaveConfigPath = path.join("temp", "test", "slave-integration.json"); +let controlConfigPath = path.join("temp", "test", "control-integration.json"); async function exec(...args) { console.log(args[0]); diff --git a/test/integration/patch.js b/test/integration/patch.js index 0d102dcb..1101e147 100644 --- a/test/integration/patch.js +++ b/test/integration/patch.js @@ -13,7 +13,7 @@ require("./server") describe("Integration of lib/factorio/patch", function() { describe("patch()", function() { - let savePath = path.join("test", "temp", "integration", "saves", "test.zip"); + let savePath = path.join("temp", "test", "integration", "saves", "test.zip"); it("should patch a freeplay game", async function() { slowTest(this); await factorio.patch(savePath, [{ diff --git a/test/integration/server.js b/test/integration/server.js index 3952bf0c..815fa852 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -20,7 +20,7 @@ describe("Integration of lib/factorio/server", function() { }); describe("class FactorioServer", function() { - let writePath = path.join("test", "temp", "integration"); + let writePath = path.join("temp", "test", "integration"); let server = new factorio.FactorioServer("factorio", writePath, {}); let logFile; diff --git a/test/lib/database.js b/test/lib/database.js index ad78688c..16d0cce1 100644 --- a/test/lib/database.js +++ b/test/lib/database.js @@ -1,5 +1,6 @@ const assert = require("assert").strict; const fs = require("fs-extra"); +const path = require("path"); const database = require("lib/database"); @@ -60,7 +61,7 @@ describe("lib/database", function() { describe("saveMapAsJson()", function() { it("should save a mapping as JSON", async function() { - let testFile = 'test/temp/save_map.json'; + let testFile = path.join("temp", "test", "save_map.json"); async function deleteTestFile() { try { await fs.unlink(testFile); @@ -134,7 +135,7 @@ describe("lib/database", function() { describe("saveMapAsJsonArray()", function() { it("should save a mapping as JSON", async function() { - let testFile = 'test/temp/save_array_map.json'; + let testFile = path.join("temp", "test", "save_array_map.json"); async function deleteTestFile() { try { await fs.unlink(testFile); diff --git a/test/lib/factorio/patch.js b/test/lib/factorio/patch.js index 3a1f890e..79eeb422 100644 --- a/test/lib/factorio/patch.js +++ b/test/lib/factorio/patch.js @@ -212,7 +212,7 @@ describe("lib/factorio", function() { it("should throw on unknown scenario", async function() { let zip = new jszip(); zip.file("world/control.lua", "-- unknown\n"); - let zipPath = path.join("test", "temp", "patch.zip"); + let zipPath = path.join("temp", "test", "patch.zip"); await fs.outputFile(zipPath, await zip.generateAsync({type: "nodebuffer"})) await assert.rejects( diff --git a/test/lib/factorio/server.js b/test/lib/factorio/server.js index e1b400e1..a004f488 100644 --- a/test/lib/factorio/server.js +++ b/test/lib/factorio/server.js @@ -166,7 +166,7 @@ describe("lib/factorio/server", function() { }); describe("class FactorioServer", function() { - let writePath = path.join("test", "temp", "should_not_exist"); + let writePath = path.join("temp", "test", "server"); let server = new factorio.FactorioServer(path.join("test", "file", "factorio"), writePath, {}); describe(".init()", function() { diff --git a/test/lib/fileOps/fileOps.js b/test/lib/fileOps/fileOps.js index a97ef57b..d507b1ab 100644 --- a/test/lib/fileOps/fileOps.js +++ b/test/lib/fileOps/fileOps.js @@ -5,7 +5,7 @@ const path = require('path'); const fileOps = require('lib/fileOps'); describe("fileOps.js", function(){ - let baseDir = path.join("test", "temp", "fileOps"); + let baseDir = path.join("temp", "test", "fileOps"); async function setupTestingEnv() { await fs.ensureDir(path.join(baseDir, "test", "folder")); await fs.ensureDir(path.join(baseDir, "test", "another folder")); diff --git a/test/lib/generateSSLcert.js b/test/lib/generateSSLcert.js index c4356262..75f43b57 100644 --- a/test/lib/generateSSLcert.js +++ b/test/lib/generateSSLcert.js @@ -5,7 +5,7 @@ const path = require("path"); const generateSSLcert = require("lib/generateSSLcert") describe("generateSSLcert.js(options)", ()=>{ - let testDir = "test/temp/certTest"; + let testDir = path.join("temp", "test", "certTest"); before(async function() { await fs.remove(testDir); }); diff --git a/test/lib/plugin.js b/test/lib/plugin.js index 9c66aed9..632708b4 100644 --- a/test/lib/plugin.js +++ b/test/lib/plugin.js @@ -35,7 +35,7 @@ describe("lib/plugin", function() { }); describe("loadPluginInfos()", function() { - let baseDir = path.join('test', 'temp', 'plugin'); + let baseDir = path.join("temp", "test", "plugin"); let emptyDir = path.join(baseDir, 'emptyDir'); let emptyPlugin = path.join(baseDir, 'emptyPlugin'); let testPlugin = path.join(baseDir, 'testPlugin'); diff --git a/test/slave.js b/test/slave.js index 424f475f..47a146b9 100644 --- a/test/slave.js +++ b/test/slave.js @@ -89,7 +89,7 @@ describe("Slave testing", function() { }); describe("symlinkMods()", function() { - let testDir = path.join("test", "temp", "symlink"); + let testDir = path.join("temp", "test", "symlink"); let discardingLogger = { warning: function() { }, log: function() { },