forked from phenom/healer-man
Release Healer Man 0.1.32
This commit is contained in:
1 parent
d3d6aaebdb
commit
6dcb1034e5
102 files changed
+10772
-788
No files matched your search
@@ -8,6 +8,7 @@ import { gunzipSync } from "node:zlib";
|
||||
import { prepareContentObjects } from "./content-objects.mjs";
|
||||
import { selectBootstrapContent } from "./prepare-bootstrap.mjs";
|
||||
import { createContentManifest } from "./publish-content.mjs";
|
||||
import contentPolicy from "../../shared/content-policy.json" with { type: "json" };
|
||||
|
||||
test("ships one lossless object for identical assets and verifies original bytes", async () => {
|
||||
const directory = await mkdtemp(path.join(os.tmpdir(), "healer-content-compression-"));
|
||||
@@ -36,17 +37,17 @@ test("ships one lossless object for identical assets and verifies original bytes
|
||||
} finally { await rm(directory, { recursive: true, force: true }); }
|
||||
});
|
||||
|
||||
test("bundles regular dungeons and exact map dependencies without installing Manastorm", () => {
|
||||
const ids = ["core:ui", "dungeon:first", "dungeon:second", "shared:creatures", "manastorm:shared-map", "manastorm:optional-map", "characters:extra"];
|
||||
test("bundles only starter packs and their exact dependencies", () => {
|
||||
const ids = [...contentPolicy.bootstrapPackIds, "dungeon:second", "shared:creatures", "manastorm:shared-map", "manastorm:optional-map", "characters:extra"];
|
||||
const files = ids.map((packId, index) => ({ logicalPath: `assets/${index}.glb`, packId, sha256: String(index).repeat(64), bytes: 100, extension: ".glb" }));
|
||||
const result = selectBootstrapContent(files, [
|
||||
{ id: "dungeon:first", dependencies: ["manastorm:shared-map", "shared:creatures"] },
|
||||
{ id: "dungeon:second", dependencies: [] },
|
||||
]);
|
||||
assert.deepEqual(result.files.map((file) => file.packId), ids.slice(0, 5));
|
||||
assert.deepEqual(result.files.map((file) => file.packId), contentPolicy.bootstrapPackIds);
|
||||
const packs = new Map(result.packDefinitions.map((pack) => [pack.id, pack]));
|
||||
assert.equal(packs.get("dungeon:first").bundledOnAndroid, true);
|
||||
assert.equal(packs.get("dungeon:second").bundledOnAndroid, true);
|
||||
assert.equal(packs.get("manastorm:shared-map").bundledOnAndroid, false);
|
||||
assert.deepEqual([...packs.keys()].sort(), [...contentPolicy.bootstrapPackIds].sort());
|
||||
assert.equal([...packs.values()].every((pack) => pack.bundledOnAndroid), true);
|
||||
assert.equal(packs.has("dungeon:second"), false);
|
||||
assert.equal(packs.has("manastorm:shared-map"), false);
|
||||
assert.equal(packs.has("manastorm:optional-map"), false);
|
||||
});
|
||||
Reference in new issue
Block a user