Update Healer Man server
This commit is contained in:
1 parent
3e30af4c98
commit
97ee0c13f9
25 files changed
+576
-179
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
ensureRandomizedBiteSizedRunContent,
|
||||
randomizedBiteSizedModelUrls,
|
||||
} from "./randomizedBiteSizedContent";
|
||||
|
||||
describe("randomized bite-sized run content", () => {
|
||||
it("derives only the distinct model URLs selected by the shared run seed", () => {
|
||||
const first = randomizedBiteSizedModelUrls("asset-seed");
|
||||
const second = randomizedBiteSizedModelUrls("asset-seed");
|
||||
expect(first).toEqual(second);
|
||||
expect(first.length).toBeGreaterThan(1);
|
||||
expect(new Set(first).size).toBe(first.length);
|
||||
expect(first.every((url) => url.startsWith("/assets/") && url.endsWith(".glb"))).toBe(true);
|
||||
});
|
||||
|
||||
it("installs the base location and only the rolled creature model packs before entry", async () => {
|
||||
const installPack = vi.fn(async () => undefined);
|
||||
const installUrls = vi.fn(async () => undefined);
|
||||
await ensureRandomizedBiteSizedRunContent("download-seed", {
|
||||
development: false,
|
||||
installPack,
|
||||
installUrls,
|
||||
packIsUsable: () => false,
|
||||
packHasUpdate: () => false,
|
||||
});
|
||||
|
||||
expect(installPack).toHaveBeenCalledWith("activity:randomized-bite-sized");
|
||||
expect(installUrls).toHaveBeenCalledWith(randomizedBiteSizedModelUrls("download-seed"));
|
||||
expect(installPack.mock.invocationCallOrder[0]).toBeLessThan(installUrls.mock.invocationCallOrder[0]);
|
||||
});
|
||||
|
||||
it("skips network installation in the unrestricted development asset server", async () => {
|
||||
const installPack = vi.fn(async () => undefined);
|
||||
const installUrls = vi.fn(async () => undefined);
|
||||
await ensureRandomizedBiteSizedRunContent("dev-seed", {
|
||||
development: true,
|
||||
installPack,
|
||||
installUrls,
|
||||
packIsUsable: () => false,
|
||||
packHasUpdate: () => false,
|
||||
});
|
||||
expect(installPack).not.toHaveBeenCalled();
|
||||
expect(installUrls).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user