m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-11 21:04:59 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-12 21:00:21 -0400
commit3915ca0932333f3d0d01538df915ac38810949cc (patch)
tree830f2cd330d74e0be41338d1cf7914533d14cc88 /__tests__
parentf07c5096999bf1a65d3082f8de42d3499b43e532 (diff)
Fix bug with compound dice
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/dice.test.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/__tests__/dice.test.js b/__tests__/dice.test.js
index fa2d2dc..4828ce4 100644
--- a/__tests__/dice.test.js
+++ b/__tests__/dice.test.js
@@ -169,7 +169,7 @@ const combinedDiceTestSpecs = (dieSpecs) => {
const expectExtrema =
dieSpecs.map(spec => (Math.pow(spec.sides, spec.number)))
- .reduce(times) < 50
+ .reduce(times) < 50
return {
diceCount: combineSpecField(spec => (spec.diceCount)),
average: {
@@ -305,4 +305,10 @@ describe('compound dice', () => {
testDie(die, testSpec)
})
+
+ describe('(2d1)d(2d1)', () => {
+ const die = d(d(constant(2), constant(1)), d(constant(2), constant(1)))
+
+ testDie(die, basicDieTestSpecs(2, 2))
+ })
})