Files
healer-man/src/game/combatHealing.test.ts
T
2026-08-20 14:05:50 -04:00

19 lines
646 B
TypeScript

import { describe, expect, it } from "vitest";
import { resolveHealing } from "./combatHealing";
describe("combat healing resolution", () => {
it("reports critical raw healing, effective healing, and overheal independently", () => {
expect(resolveHealing(100, 950, 1_000, 0.25, 0.1)).toEqual({
rawAmount: 150,
effectiveAmount: 50,
overheal: 100,
critical: true,
});
});
it("does not resurrect a zero-health actor implicitly", () => {
const result = resolveHealing(100, 0, 1_000, 0, 1);
expect(result).toMatchObject({ rawAmount: 100, effectiveAmount: 100, overheal: 0, critical: false });
});
});