Files
healer-man/src/game/bossPressure.test.ts
T
2026-09-16 14:30:58 -04:00

33 lines
1.6 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { estimateBossPartyPressure, rankBossPartyPressure } from "./bossPressure";
import { DUNGEON_DEFINITIONS } from "./dungeonRegistry";
describe("boss party-pressure audit", () => {
it("produces a finite deterministic ranking for every WoW boss", () => {
const definitions = DUNGEON_DEFINITIONS.filter((dungeon) => dungeon.expansion !== "runewaker");
const first = rankBossPartyPressure(definitions);
const second = rankBossPartyPressure(definitions);
expect(first.length).toBeGreaterThan(200);
expect(second).toEqual(first);
expect(first.every((entry) => Number.isFinite(entry.partyDamagePerSecond)
&& entry.partyDamagePerSecond >= 0)).toBe(true);
expect(first.map((entry) => entry.partyDamage)).toEqual(
[...first.map((entry) => entry.partyDamage)].sort((left, right) => right - left),
);
});
it("counts grouped effects across the party and excludes self-only utility", () => {
const gundrak = DUNGEON_DEFINITIONS.find((dungeon) => dungeon.id === "gundrak")!;
const eckId = Object.entries(gundrak.entities)
.find(([, entity]) => entity.combat?.serverEntry === 29_932)![0];
const estimate = estimateBossPartyPressure(gundrak, eckId);
expect(estimate.boss).toBe("Eck the Ferocious");
expect(estimate.attacks.find((attack) => attack.spellId === 55_837)?.partyDamage).toBe(0);
expect(estimate.attacks.find((attack) => attack.spellId === 55_816)?.partyDamage).toBe(0);
expect(estimate.attacks.find((attack) => attack.spellId === 55_815)).toMatchObject({
target: "random-party",
targetsPerCast: 1,
});
});
});