mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
Add default mod packs (#735)
This commit is contained in:
1 parent
7b8945ff15
commit
8996671bea
6 files changed
+72
-1
No files matched your search
@@ -1072,8 +1072,15 @@ describe("Integration of Clusterio", function() {
|
||||
});
|
||||
|
||||
describe("mod-pack list", function() {
|
||||
let result = null;
|
||||
it("runs", async function() {
|
||||
await execCtl("mod-pack list");
|
||||
result = await execCtl("mod-pack list");
|
||||
});
|
||||
it("contains defaults", function() {
|
||||
assert(result !== null, "Failed to return a value");
|
||||
const stdout = result.stdout.trim();
|
||||
assert(stdout.indexOf("Base Game") >= 0, "No base game pack");
|
||||
assert(stdout.indexOf("Space Age") >= 0, "No space age pack");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -378,6 +378,24 @@ describe("lib/data/ModPack", function() {
|
||||
/* eslint-enable indent */
|
||||
});
|
||||
});
|
||||
describe("defaultModPacks", function() {
|
||||
it("should contain at least one base game only", function() {
|
||||
const modPack = ModPack.defaultModPacks.find(pack => {
|
||||
const base = pack.mods.get("base");
|
||||
const spaceAge = pack.mods.get("space-age");
|
||||
return base && base.enabled && (!spaceAge || !spaceAge.enabled);
|
||||
});
|
||||
assert(modPack, "Does not contain base game only");
|
||||
});
|
||||
it("should contain at least one space age expansion", function() {
|
||||
const modPack = ModPack.defaultModPacks.find(pack => {
|
||||
const base = pack.mods.get("base");
|
||||
const spaceAge = pack.mods.get("space-age");
|
||||
return base && base.enabled && spaceAge && spaceAge.enabled;
|
||||
});
|
||||
assert(modPack, "Does not contain space age expansion");
|
||||
});
|
||||
});
|
||||
describe("getBuiltinMods()", function() {
|
||||
it("should work with versions before 2.0", function() {
|
||||
const builtinMods = ModPack.getBuiltinMods("1.1");
|
||||
|
||||
@@ -413,6 +413,22 @@ describe("lib/datastore", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("size", function() {
|
||||
it("returns the correct size", function() {
|
||||
assert.equal(datastore.size, 3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("iterator", function() {
|
||||
it("iterates all values", function() {
|
||||
const entries = [];
|
||||
for (const entry of datastore) {
|
||||
entries.push(entry);
|
||||
}
|
||||
assert.deepEqual(entries, [...datastoreProvider.value.entries()]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("values", function() {
|
||||
it("returns all values", function() {
|
||||
assert.deepEqual([...datastore.values()], [...datastoreProvider.value.values()]);
|
||||
|
||||
Reference in new issue
Block a user