Source factorio dir from config-host.json in tests

If a factorio dir is configured in config-host.json then use that in the
tests.  This removes the requirement of having a factorio installation
in ./factorio or linking to one there when running the tests.
This commit is contained in:
Hornwitser committed 2024-09-03 21:58:45 +02:00
1 parent f3150a9261
commit 5d97e8e816
3 files changed
+30 -5

No files matched your search

+3 -1
View File
@@ -5,12 +5,14 @@ const path = require("path");
const { _exportLocale } = require("@clusterio/host/dist/node/src/export");
const { FactorioServer } = require("@clusterio/host/dist/node/src/server");
const { factorioDir } = require("./index");
describe("Integration of lib/factorio/export", function() {
describe("exportLocale()", function() {
it("returns a nested Map with base game locale information", async function() {
let writePath = path.join("temp", "test", "server");
let testServer = new FactorioServer("factorio", writePath, {});
let testServer = new FactorioServer(factorioDir, writePath, {});
await testServer.init();
let locale = await _exportLocale(testServer, new Map(), ["base"], "en");