43 lines
2.1 KiB
TypeScript
43 lines
2.1 KiB
TypeScript
import { afterAll, describe, expect, it } from "vitest";
|
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
import { COA_CLASS_IDS } from "../app/characterCatalog";
|
|
import { loadCanonicalBenchmarkBuilds } from "./benchmark/benchmarkBuilds";
|
|
import { BENCHMARK_POLICY_ID } from "./benchmark/benchmarkController";
|
|
import { runDungeonBossBenchmark } from "./benchmark/dungeonBossBenchmark";
|
|
import { requireDungeonDefinition } from "./dungeonRegistry";
|
|
import { finalDungeonBoss } from "./dungeonRunStore";
|
|
|
|
const dungeon = requireDungeonDefinition("ragefire-chasm");
|
|
const boss = finalDungeonBoss(dungeon)!;
|
|
const samples: unknown[] = [];
|
|
|
|
afterAll(() => {
|
|
if (process.env.HEALER_BALANCE_REPORT !== "1") return;
|
|
mkdirSync("artifacts/boss-difficulty", { recursive: true });
|
|
writeFileSync("artifacts/boss-difficulty/coa-healer-balance.json", `${JSON.stringify({
|
|
dungeon: dungeon.id, difficulty: 1, durationLimitSeconds: 60, policy: BENCHMARK_POLICY_ID,
|
|
gear: "resolved starter heirlooms", samples,
|
|
}, null, 2)}\n`);
|
|
});
|
|
|
|
describe("default difficulty CoA healer rotations", () => {
|
|
for (const level of [8, 20, 40, 80]) {
|
|
it(`sustains healing against final boss attacks at level ${level}`, async () => {
|
|
const builds = (await loadCanonicalBenchmarkBuilds(level, COA_CLASS_IDS)).filter(build => build.role === "healer");
|
|
expect(builds).toHaveLength(9);
|
|
const failures: string[] = [];
|
|
for (const build of builds) {
|
|
await new Promise<void>(resolve => setTimeout(resolve, 0));
|
|
for (const seed of ["class-balance-1", "class-balance-2", "class-balance-3"]) {
|
|
const result = await runDungeonBossBenchmark(build, boss.id, seed, true);
|
|
samples.push({ level, classId: build.classId, orientation: build.orientation, seed, result });
|
|
if (!result.playerAlive || result.allyHealing <= 0 || result.deaths > 0) {
|
|
failures.push(`${build.id}:${seed}: ${result.outcome}, ${result.deaths} deaths, ${result.allyHealing} ally healing`);
|
|
}
|
|
}
|
|
}
|
|
expect(failures).toEqual([]);
|
|
}, 120_000);
|
|
}
|
|
});
|