ds4/spec/support/ds4rolls.spec.ts

15 lines
629 B
TypeScript
Raw Normal View History

2020-12-30 21:50:12 +01:00
import { rollCheckSingleDie, RollOptions, RollResult, RollResultStatus } from "../../src/module/rolls/roll-executor";
import { RollProvider } from "../../src/module/rolls/roll-provider";
describe("DS4 Rolls", () => {
it("Should do a proper single success role", () => {
const rollProvider: RollProvider = jasmine.createSpyObj("rollProvider", ["getNextRoll"]);
rollProvider.getNextRoll = jasmine.createSpy("getNextRoll").and.returnValue(4);
expect(rollCheckSingleDie(12, new RollOptions(), rollProvider)).toEqual(
new RollResult(4, RollResultStatus.SUCCESS, [4]),
);
});
});