mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
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.
This commit is contained in:
1 parent
f6eb55163f
commit
05ae607a6a
1 file changed
+17
-15
+17
-15
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user