Move Factorio server implementation to host

Move Factorio related code in lib that's only used by the host into the
host package.
This commit is contained in:
Hornwitser committed 2023-07-28 16:03:29 +02:00
1 parent bc574ee1cb
commit 6af25e085c
13 files changed
+95 -100

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@ const fs = require("fs-extra");
const JSZip = require("jszip");
const path = require("path");
const lib = require("@clusterio/lib");
const { patch } = require("@clusterio/host/src/patch");
const { slowTest } = require("./index");
@@ -17,7 +17,7 @@ describe("Integration of lib/factorio/patch", function() {
let savePath = path.join("temp", "test", "integration", "saves", "test.zip");
it("should patch a freeplay game", async function() {
slowTest(this);
await lib.patch(savePath, [{
await patch(savePath, [{
name: "test",
version: "1.0.0",
dependencies: {},
@@ -39,7 +39,7 @@ describe("Integration of lib/factorio/patch", function() {
});
it("should remove old modules in a save", async function() {
slowTest(this);
await lib.patch(savePath, []);
await patch(savePath, []);
let zip = await JSZip.loadAsync(await fs.readFile(savePath));
assert.equal(zip.file("test/modules/test/test.lua"), null);
});