Files
factorio-clusterio/test/host/export.js
T
Hornwitser 6af25e085c Move Factorio server implementation to host
Move Factorio related code in lib that's only used by the host into the
host package.
2023-07-28 16:03:29 +02:00

24 lines
780 B
JavaScript

"use strict";
const assert = require("assert").strict;
const path = require("path");
const { FactorioServer } = require("@clusterio/host/src/server");
const { _exportLocale } = require("@clusterio/host/src/export");
describe("host/src/export", function() {
describe("exportLocale()", function() {
let testServer;
before(async function() {
let writePath = path.join("temp", "test", "server");
testServer = new FactorioServer(path.join("test", "file", "factorio"), writePath, {});
await testServer.init();
});
it("returns a flattened mapping with locale definitions", async function() {
let locale = await _exportLocale(testServer, new Map(), ["base"], "en");
assert.deepEqual(locale, new Map([["test.key-a", "1"], ["test.key-b", "2"]]));
});
});
});