Release Healer Man 0.1.21

This commit is contained in:
phenom committed 2026-09-08 10:40:26 -04:00
1 parent 699fc858c9
commit f6f2375145
210 files changed
+976039 -6247

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
import { describe, expect, it } from "vitest";
import { createDungeonEncounterSnapshot } from "./dungeonEncounterRuntime";
import type { DungeonEncounterDefinition } from "./dungeonEncounterTypes";
import {
DUNGEON_RUN_CHECKPOINT_VERSION,
normalizeDungeonRunCheckpoint,
} from "./dungeonRunCheckpoint";
const definition: DungeonEncounterDefinition = {
id: "test:boss",
dungeonId: "test",
initialPhase: "ready",
rules: [],
};
describe("dungeon run checkpoints", () => {
it("normalizes JSON-safe encounter progress and world spawn", () => {
const result = normalizeDungeonRunCheckpoint({
version: DUNGEON_RUN_CHECKPOINT_VERSION,
dungeonId: "test",
difficultyId: "normal",
checkpointId: "entrance",
spawn: { footPosition: [1, 2, 3], yaw: 0.5 },
encounters: [createDungeonEncounterSnapshot(definition)],
savedAt: 123,
});
expect(result).toMatchObject({ dungeonId: "test", checkpointId: "entrance" });
expect(result?.encounters[0]?.encounterId).toBe("test:boss");
});
it("fails closed on malformed or unbounded data", () => {
expect(normalizeDungeonRunCheckpoint({})).toBeNull();
expect(normalizeDungeonRunCheckpoint({
version: DUNGEON_RUN_CHECKPOINT_VERSION,
dungeonId: "test",
difficultyId: "normal",
checkpointId: null,
spawn: { footPosition: [Number.NaN, 2, 3], yaw: 0 },
encounters: [],
savedAt: 1,
})).toBeNull();
});
});