From 05ae607a6a4ef3d5cb8183d2b0fb0fe721ce95a1 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Mon, 9 Mar 2026 20:09:07 +0100 Subject: [PATCH] Fix tests for checkForUpdates Fix incorrect suite name and attempting to test no version matches using the "latest" version which always matches in the tests for the FactorioServer.checkForUpdates method. --- test/host/server.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/test/host/server.js b/test/host/server.js index 70f9cff8..13de4e75 100644 --- a/test/host/server.js +++ b/test/host/server.js @@ -348,7 +348,7 @@ describe("host/server", function() { ["latest version", "latest"], ]) { /* eslint-disable no-loop-func */ - describe("full version", function() { + describe(suite, function() { it("should do nothing when there are no versions", async function() { server._factorioDir = path.join("test", "file", "factorio"); server._targetVersion = target; @@ -356,21 +356,23 @@ describe("host/server", function() { assert.equal(fetchCalledWith, null); }); - it("should do nothing when no version matches", async function() { - server._factorioDir = path.join("test", "file", "factorio"); - server._targetVersion = target; - await server.checkForUpdates([{ - stable: true, - version: "0.2.1", - headlessUrl: "test1", - }, { - stable: false, - version: "0.2.0", - headlessUrl: "test2", - }]); + if (target !== "latest") { + it("should do nothing when no version matches", async function() { + server._factorioDir = path.join("test", "file", "factorio"); + server._targetVersion = target; + await server.checkForUpdates([{ + stable: true, + version: "0.2.1", + headlessUrl: "test1", + }, { + stable: false, + version: "0.2.0", + headlessUrl: "test2", + }]); - assert.equal(fetchCalledWith, null); - }); + assert.equal(fetchCalledWith, null); + }); + } it("should do nothing when there is no newer version", async function() { server._factorioDir = path.join("test", "file", "factorio"); server._targetVersion = target;