mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
Remove app-root-path
Resolve the relative path using path.relative instead of some hacky string substitutions.
This commit is contained in:
1 parent
1e8fb85122
commit
a452749caa
3 files changed
+2
-5
No files matched your search
@@ -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,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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user