Fix tests.
This commit is contained in:
parent
1422f28760
commit
14ffff1985
2 changed files with 14 additions and 10 deletions
|
@ -110,7 +110,7 @@ describe("DS4 Rolls with multiple dice and no modifiers.", () => {
|
|||
|
||||
it("Should succeed normally with all rolls crit successes.", () => {
|
||||
expect(rollCheckMultipleDice(48, {}, [1, 1, 1])).toEqual(
|
||||
new RollResult(48, RollResultStatus.SUCCESS, [1, 1, 1]),
|
||||
new RollResult(48, RollResultStatus.CRITICAL_SUCCESS, [1, 1, 1]),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -151,16 +151,20 @@ describe("DS4 Rolls with multiple dice and no modifiers.", () => {
|
|||
});
|
||||
|
||||
it("Should maximize on 2-dice 'lowest dice higher than last CTN and crit success thrown'-Edge case, no change required.", () => {
|
||||
expect(rollCheckMultipleDice(24, {}, [1, 8])).toEqual(new RollResult(20, RollResultStatus.SUCCESS, [1, 8]));
|
||||
expect(rollCheckMultipleDice(24, {}, [1, 8])).toEqual(
|
||||
new RollResult(20, RollResultStatus.CRITICAL_SUCCESS, [1, 8]),
|
||||
);
|
||||
});
|
||||
|
||||
it("Should maximize on 2-dice 'lowest dice higher than last CTN and crit success thrown'-Edge case, change required.", () => {
|
||||
expect(rollCheckMultipleDice(38, {}, [1, 19])).toEqual(new RollResult(37, RollResultStatus.SUCCESS, [1, 19]));
|
||||
expect(rollCheckMultipleDice(38, {}, [1, 19])).toEqual(
|
||||
new RollResult(37, RollResultStatus.CRITICAL_SUCCESS, [1, 19]),
|
||||
);
|
||||
});
|
||||
|
||||
it("Should maximize correctly when swapping with more than one crit success", () => {
|
||||
expect(rollCheckMultipleDice(48, {}, [1, 1, 15])).toEqual(
|
||||
new RollResult(43, RollResultStatus.SUCCESS, [1, 1, 15]),
|
||||
new RollResult(43, RollResultStatus.CRITICAL_SUCCESS, [1, 1, 15]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -174,7 +178,7 @@ describe("DS4 Rolls with multiple dice and min/max modifiers.", () => {
|
|||
|
||||
it("Should succeed with all rolls crit successes (1 and 2).", () => {
|
||||
expect(rollCheckMultipleDice(48, { maxCritSucc: 2, minCritFail: 19 }, [2, 1, 2])).toEqual(
|
||||
new RollResult(48, RollResultStatus.SUCCESS, [2, 1, 2]),
|
||||
new RollResult(48, RollResultStatus.CRITICAL_SUCCESS, [2, 1, 2]),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -214,7 +218,7 @@ describe("DS4 Rolls with multiple dice and fail modifiers.", () => {
|
|||
describe("DS4 Rolls with multiple dice and success modifiers.", () => {
|
||||
it("Should succeed with all rolls crit successes (1 and 2).", () => {
|
||||
expect(rollCheckMultipleDice(48, { maxCritSucc: 2 }, [2, 1, 2])).toEqual(
|
||||
new RollResult(48, RollResultStatus.SUCCESS, [2, 1, 2]),
|
||||
new RollResult(48, RollResultStatus.CRITICAL_SUCCESS, [2, 1, 2]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -36,8 +36,8 @@ export class RollResult {
|
|||
}
|
||||
|
||||
export enum RollResultStatus {
|
||||
FAILURE,
|
||||
SUCCESS,
|
||||
CRITICAL_FAILURE,
|
||||
CRITICAL_SUCCESS,
|
||||
FAILURE = "FAILURE",
|
||||
SUCCESS = "SUCCESS",
|
||||
CRITICAL_FAILURE = "CRITICAL_FAILURE",
|
||||
CRITICAL_SUCCESS = "CRITICAL_SUCCESS",
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue