Additional tests and features as per Request.
This commit is contained in:
parent
bf39f35504
commit
6b18e720a1
3 changed files with 27 additions and 2 deletions
|
@ -244,3 +244,27 @@ describe("DS4 Rools with multiple dice and min/max modifiers.", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("DS4 Rools with multiple dice and fail modifiers.", () => {
|
||||
it("Should do a crit fail on `19` for first roll.", () => {
|
||||
const rollProvider: RollProvider = jasmine.createSpyObj("rollProvider", ["getNextRolls"]);
|
||||
|
||||
rollProvider.getNextRolls = jasmine.createSpy("getNextRolls").and.returnValue([19, 15, 6]);
|
||||
|
||||
expect(rollCheckMultipleDice(48, { minCritFail: 19 } as RollOptions, rollProvider)).toEqual(
|
||||
new RollResult(0, RollResultStatus.CRITICAL_FAILURE, [19, 15, 6]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("DS4 Rools with multiple dice and success modifiers.", () => {
|
||||
it("Should succeed with all rolls crit successes (1 and 2).", () => {
|
||||
const rollProvider: RollProvider = jasmine.createSpyObj("rollProvider", ["getNextRolls"]);
|
||||
|
||||
rollProvider.getNextRolls = jasmine.createSpy("getNextRolls").and.returnValue([2, 1, 2]);
|
||||
|
||||
expect(rollCheckMultipleDice(48, { maxCritSucc: 2 } as RollOptions, rollProvider)).toEqual(
|
||||
new RollResult(48, RollResultStatus.SUCCESS, [2, 2, 1]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue