m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/dice.test.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/__tests__/dice.test.js b/__tests__/dice.test.js
index 5d3fac1..9f3106e 100644
--- a/__tests__/dice.test.js
+++ b/__tests__/dice.test.js
@@ -40,7 +40,7 @@ expect.extend({
toAllBe(received, expected) {
const pass = received.reduce((allOk, value) => {
return allOk && value === expected
- })
+ }, true)
return {
pass,
@@ -74,7 +74,7 @@ const rollForTest = (die, numberRolls) => {
for (let i = 0; i < numberRolls; i++) {
let rolled = pool(die)
pools.push(rolled)
- rolls.push(rolled.reduce(plus))
+ rolls.push(rolled.reduce(plus, 0))
}
return { pools, rolls }
@@ -263,6 +263,7 @@ describe('constant', () => {
describe('basic dice', () => {
describeBasicDie(1, 6)
+ describeBasicDie(0, 6)
describeBasicDie(2, 8, 500)
describeBasicDie(20, 1)
})