Remove app-root-path

Resolve the relative path using path.relative instead of some hacky
string substitutions.
This commit is contained in:
Hornwitser committed 2019-08-07 10:18:14 +02:00
1 parent 1e8fb85122
commit a452749caa
3 files changed
+2 -5

No files matched your search

-1
View File
@@ -15,7 +15,6 @@ const child_process = require("child_process");
const path = require("path");
const mkdirp = require("mkdirp");
const appRootPath = require("app-root-path");
const fileOps = require("lib/fileOps");
+2 -3
View File
@@ -2,7 +2,6 @@ const assert = require("assert");
const fs = require("fs");
const path = require("path");
const appRootPath = require("app-root-path");
const parallel = require("mocha.parallel");
const mkdirp = require("mkdirp");
@@ -75,7 +74,7 @@ describe("class factorioServer/index.js", ()=>{
describe(".createMap(mapName.zip)", ()=>{
it("creates a map file as instanceDirectory/saves/map.zip", async function(){
this.timeout(20000); // these test often takes a lot of time in the map creation step (4500 ms on i3 dev system)
let relativePath = __dirname.replace(appRootPath, "").substr(1);
let relativePath = path.relative('.', __dirname);
let server = new factorioServer({
instanceDirectory: path.join(relativePath, "_testData_createMap"),
instanceName: "Unit testing instance",
@@ -93,7 +92,7 @@ describe("class factorioServer/index.js", ()=>{
});
it("supports custom filenames", async function(){
this.timeout(20000);
let relativePath = __dirname.replace(appRootPath, "").substr(1);
let relativePath = path.relative('.', __dirname);
let server = new factorioServer({
instanceDirectory: path.join(relativePath, "_testData_createMap_2"),
instanceName: "Unit testing instance",
-1
View File
@@ -17,7 +17,6 @@
"author": "Danielv123",
"license": "ISC",
"dependencies": {
"app-root-path": "^2.0.1",
"as-table": "^1.0.31",
"averaged-timeseries": "^1.4.0",
"base64url": "^3.0.0",